CVE-2022-49170·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to do sanity check on curseg->alloc_type As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215657 - Overview UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image - Reproduce tested on kernel 5.17-rc4, 5.17-rc6 1. mkdir test_crash 2. cd test_crash 3. unzip tmp2.zip 4. mkdir mnt 5. ./single_test.sh f2fs 2 - Kernel dump [ 46.434454] loop0: detected capacity change from 0 to 131072 [ 46.529839] F2FS-fs (loop0): Mounted with checkpoint version = 7548c2d9 [ 46.738319] ================================================================================ [ 46.738412] UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 [ 46.738475] index 231 is out of range for type 'unsigned int [2]' [ 46.738539] CPU: 2 PID: 939 Comm: umount Not tainted 5.17.0-rc6 #1 [ 46.738547] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 46.738551] Call Trace: [ 46.738556] <TASK> [ 46.738563] dump_stack_lvl+0x47/0x5c [ 46.738581] ubsan_epilogue+0x5/0x50 [ 46.738592] __ubsan_handle_out_of_bounds+0x68/0x80 [ 46.738604] f2fs_allocate_data_block+0xdff/0xe60 [f2fs] [ 46.738819] do_write_page+0xef/0x210 [f2fs] [ 46.738934] f2fs_do_write_node_page+0x3f/0x80 [f2fs] [ 46.739038] __write_node_page+0x2b7/0x920 [f2fs] [ 46.739162] f2fs_sync_node_pages+0x943/0xb00 [f2fs] [ 46.739293] f2fs_write_checkpoint+0x7bb/0x1030 [f2fs] [ 46.739405] kill_f2fs_super+0x125/0x150 [f2fs] [ 46.739507] deactivate_locked_super+0x60/0xc0 [ 46.739517] deactivate_super+0x70/0xb0 [ 46.739524] cleanup_mnt+0x11a/0x200 [ 46.739532] __cleanup_mnt+0x16/0x20 [ 46.739538] task_work_run+0x67/0xa0 [ 46.739547] exit_to_user_mode_prepare+0x18c/0x1a0 [ 46.739559] syscall_exit_to_user_mode+0x26/0x40 [ 46.739568] do_syscall_64+0x46/0xb0 [ 46.739584] entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is we missed to do sanity check on curseg->alloc_type, result in out-of-bound accessing on sbi->block_count[] array, fix it.
- Severity
- high
- Software
- Kernel
- Fixed in
- 5.17.2
- Published
- 2025-02-26
Affected versions
From: 5.17
Until: 5.17.2
Fixed in: 5.17.2
How to fix this CVE
Update your Linux kernel to version 5.17.2 or later to resolve this F2FS filesystem validation flaw. The vulnerability stems from insufficient sanity checks on segment allocation type values, which can cause out-of-bounds array access during filesystem operations. Apply the kernel security patch immediately, especially if you use F2FS on your systems.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Check your kernel version: uname -r — compare against 5.17.2 (vulnerable if 5.17.0 to 5.17.1)
- Verify F2FS usage: grep f2fs /etc/fstab or mount | grep f2fs — this CVE only affects systems using F2FS filesystems
- Search kernel logs for UBSAN errors: dmesg | grep -i 'array-index-out-of-bounds\|fs/f2fs/segment' — indicates exploitation attempts
- Confirm patch application: cat /proc/version — verify kernel version is 5.17.2+ after reboot
FAQ
What is CVE-2022-49170?
This is a kernel vulnerability in the F2FS filesystem driver where missing validation of cursor segment allocation types allows an array index to exceed bounds, triggering memory access violations when the filesystem processes corrupted metadata.
Is CVE-2022-49170 being actively exploited?
No — this vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available, though it requires local access and malicious F2FS image files to trigger.
What versions of Kernel are affected by CVE-2022-49170?
Linux kernel versions 5.17.0 through 5.17.1 are vulnerable; version 5.17.2 and later contain the fix.
How do I check if my server is vulnerable to CVE-2022-49170?
Run 'uname -r' to check your kernel version and 'mount | grep f2fs' to verify F2FS usage — you are vulnerable if kernel is 5.17.0–5.17.1 AND F2FS filesystems are mounted.
Does Defensia detect CVE-2022-49170?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Kernel is installed on a monitored server, CVE-2022-49170 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0748a0f7dcb9d9dddc80302d73ebcecef6782ef0
- https://git.kernel.org/stable/c/498b7088db71f9707359448cd6800bbb1882f4c3
- https://git.kernel.org/stable/c/c12765e3f129b144421c80d3383df885f85ee290
- https://git.kernel.org/stable/c/f41ee8b91c00770d718be2ff4852a80017ae9ab3
- https://git.kernel.org/stable/c/f68caedf264a95c0b02dfd0d9f92ac2637d5848a
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2022-49170. Free for 1 server.
Get started free