{"id":"CVE-2022-49170","title":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix to do sanity check on curseg->alloc_type\n\nAs Wenqing Liu reported in bugzilla:\n\nhttps://bugzilla.kernel.org/show_bug.cgi?id=215657\n\n- Overview\nUBSAN: array-in…","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix to do sanity check on curseg->alloc_type\n\nAs Wenqing Liu reported in bugzilla:\n\nhttps://bugzilla.kernel.org/show_bug.cgi?id=215657\n\n- Overview\nUBSAN: array-in…","severity":"high","cvss":7.8,"cvssVector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","cwe":["CWE-129"],"vendor":"linux","product":"linux_kernel","affected":["linux_kernel >= 3.8, < 5.10.110","linux_kernel >= 5.11, < 5.15.33","linux_kernel >= 5.16, < 5.16.19","linux_kernel >= 5.17, < 5.17.2"],"patched":["linux_kernel 5.17.2"],"published":"2025-02-26","updated":"2026-08-13","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2022-49170","references":[{"url":"https://git.kernel.org/stable/c/0748a0f7dcb9d9dddc80302d73ebcecef6782ef0","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/498b7088db71f9707359448cd6800bbb1882f4c3","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/c12765e3f129b144421c80d3383df885f85ee290","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/f41ee8b91c00770d718be2ff4852a80017ae9ab3","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/f68caedf264a95c0b02dfd0d9f92ac2637d5848a","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}],"tags":["nvd"],"epss":0.00275,"epssPercentile":0.20183,"ingestedAt":"2026-08-13T00:57:22.842Z","slug":"CVE-2022-49170","body":"## Overview\n\nIn the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix to do sanity check on curseg->alloc_type\n\nAs Wenqing Liu reported in bugzilla:\n\nhttps://bugzilla.kernel.org/show_bug.cgi?id=215657\n\n- Overview\nUBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image\n\n- Reproduce\ntested on kernel 5.17-rc4, 5.17-rc6\n\n1. mkdir test_crash\n2. cd test_crash\n3. unzip tmp2.zip\n4. mkdir mnt\n5. ./single_test.sh f2fs 2\n\n- Kernel dump\n[   46.434454] loop0: detected capacity change from 0 to 131072\n[   46.529839] F2FS-fs (loop0): Mounted with checkpoint version = 7548c2d9\n[   46.738319] ================================================================================\n[   46.738412] UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2\n[   46.738475] index 231 is out of range for type 'unsigned int [2]'\n[   46.738539] CPU: 2 PID: 939 Comm: umount Not tainted 5.17.0-rc6 #1\n[   46.738547] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014\n[   46.738551] Call Trace:\n[   46.738556]  <TASK>\n[   46.738563]  dump_stack_lvl+0x47/0x5c\n[   46.738581]  ubsan_epilogue+0x5/0x50\n[   46.738592]  __ubsan_handle_out_of_bounds+0x68/0x80\n[   46.738604]  f2fs_allocate_data_block+0xdff/0xe60 [f2fs]\n[   46.738819]  do_write_page+0xef/0x210 [f2fs]\n[   46.738934]  f2fs_do_write_node_page+0x3f/0x80 [f2fs]\n[   46.739038]  __write_node_page+0x2b7/0x920 [f2fs]\n[   46.739162]  f2fs_sync_node_pages+0x943/0xb00 [f2fs]\n[   46.739293]  f2fs_write_checkpoint+0x7bb/0x1030 [f2fs]\n[   46.739405]  kill_f2fs_super+0x125/0x150 [f2fs]\n[   46.739507]  deactivate_locked_super+0x60/0xc0\n[   46.739517]  deactivate_super+0x70/0xb0\n[   46.739524]  cleanup_mnt+0x11a/0x200\n[   46.739532]  __cleanup_mnt+0x16/0x20\n[   46.739538]  task_work_run+0x67/0xa0\n[   46.739547]  exit_to_user_mode_prepare+0x18c/0x1a0\n[   46.739559]  syscall_exit_to_user_mode+0x26/0x40\n[   46.739568]  do_syscall_64+0x46/0xb0\n[   46.739584]  entry_SYSCALL_64_after_hwframe+0x44/0xae\n\nThe root cause is we missed to do sanity check on curseg->alloc_type,\nresult in out-of-bound accessing on sbi->block_count[] array, fix it.\n\n## Affected\n\n- `linux_kernel >= 3.8, < 5.10.110`\n- `linux_kernel >= 5.11, < 5.15.33`\n- `linux_kernel >= 5.16, < 5.16.19`\n- `linux_kernel >= 5.17, < 5.17.2`\n\n## Remediation\n\nUpgrade past the affected range:\n\n- `linux_kernel 5.17.2`","depth":"twilight","depthScore":43,"depthScoreParts":{"impact":42.9,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}