CVE-2024-33847 f2fs: compress: don't allow unaligned truncation on released compress inode

High 7.1 Published Updated

A local attacker can corrupt the f2fs filesystem by performing unaligned truncation on a released compressed inode, leading to data integrity issues and potential denial of service.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-33847?

CVE-2024-33847 is a high-severity denial of service vulnerability in Linux kernel, published on 24 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

f2fs: compress: don't allow unaligned truncation on released compress inode

f2fs image may be corrupted after below testcase: - mkfs.f2fs -O extra_attr,compression -f /dev/vdb - mount /dev/vdb /mnt/f2fs - touch /mnt/f2fs/file - f2fs_io setflags compression /mnt/f2fs/file - dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=4 - f2fs_io release_cblocks /mnt/f2fs/file - truncate -s 8192 /mnt/f2fs/file - umount /mnt/f2fs - fsck.f2fs /dev/vdb

[ASSERT] (fsck_chk_inode_blk:1256) --> ino: 0x5 has i_blocks: 0x00000002, but has 0x3 blocks [FSCK] valid_block_count matching with CP [Fail] [0x4, 0x5] [FSCK] other corrupted bugs [Fail]

The reason is: partial truncation assume compressed inode has reserved blocks, after partial truncation, valid block count may change w/o .i_blocks and .total_valid_block_count update, result in corruption.

This patch only allow cluster size aligned truncation on released compress inode for fixing.

Which versions are affected by CVE-2024-33847?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-33847?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-33847 being exploited?

There is no known exploitation of CVE-2024-33847 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2024-33847, DEBIAN-CVE-2024-33847, GHSA-8wrm-f3cq-6c93, UBUNTU-CVE-2024-33847.

Is CVE-2024-33847 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free