{"id":"CVE-2024-33847","summary":"f2fs: compress: don't allow unaligned truncation on released compress inode","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: compress: don't allow unaligned truncation on released compress inode\n\nf2fs image may be corrupted after below testcase:\n- mkfs.f2fs -O extra_attr,compression -f /dev/vdb\n- mount /dev/vdb /mnt/f2fs\n- touch /mnt/f2fs/file\n- f2fs_io setflags compression /mnt/f2fs/file\n- dd if=/dev/zero of=/mnt/f2fs/file bs=4k count=4\n- f2fs_io release_cblocks /mnt/f2fs/file\n- truncate -s 8192 /mnt/f2fs/file\n- umount /mnt/f2fs\n- fsck.f2fs /dev/vdb\n\n[ASSERT] (fsck_chk_inode_blk:1256)  --\u003e ino: 0x5 has i_blocks: 0x00000002, but has 0x3 blocks\n[FSCK] valid_block_count matching with CP             [Fail] [0x4, 0x5]\n[FSCK] other corrupted bugs                           [Fail]\n\nThe reason is: partial truncation assume compressed inode has reserved\nblocks, after partial truncation, valid block count may change w/o\n.i_blocks and .total_valid_block_count update, result in corruption.\n\nThis patch only allow cluster size aligned truncation on released\ncompress inode for fixing.","modified":"2026-03-20T12:36:18.050604Z","published":"2024-06-24T13:56:48.723Z","related":["MGASA-2024-0263","MGASA-2024-0266"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/33xxx/CVE-2024-33847.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/29ed2b5dd521ce7c5d8466cd70bf0cc9d07afeee"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3ccf5210dc941a7aa0180596ac021568be4d35ec"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5268241b41b1c5d0acca75e9b97d4fd719251c8c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/8acae047215024d1ac499b3c8337ef1b952f160b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9f9341064a9b5246a32a7fe56b9f80c6f7f3c62d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b8962cf98595d1ec62f40f23667de830567ec8bc"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/33xxx/CVE-2024-33847.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-33847"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"8e1651cd667cd6779db28314844d88b6de8312a3"},{"fixed":"b8962cf98595d1ec62f40f23667de830567ec8bc"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"c61404153eb683da9c35aad133131554861ed561"},{"fixed":"8acae047215024d1ac499b3c8337ef1b952f160b"},{"fixed":"3ccf5210dc941a7aa0180596ac021568be4d35ec"},{"fixed":"9f9341064a9b5246a32a7fe56b9f80c6f7f3c62d"},{"fixed":"5268241b41b1c5d0acca75e9b97d4fd719251c8c"},{"fixed":"29ed2b5dd521ce7c5d8466cd70bf0cc9d07afeee"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-33847.json"}}],"schema_version":"1.7.5"}