CVE-2022-49408: ext4: fix memory leak in parse_apply_sb_mount_options()
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix memory leak in parseapplysbmountoptions()
If processing the on-disk mount options fails after any memory was allocated in the ext4fscontext, e.g. sqfnames, then this memory is leaked. Fix this by calling ext4fcfree() instead of kfree() directly.
Reproducer:
mkfs.ext4 -F /dev/vdc tune2fs /dev/vdc -E mountopts=usrjquota=file echo clear > /sys/kernel/debug/kmemleak mount /dev/vdc /vdc echo scan > /sys/kernel/debug/kmemleak sleep 5 echo scan > /sys/kernel/debug/kmemleak cat /sys/kernel/debug/kmemleak
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.18.5-1 - Compensating control
In parse_apply_sb_mount_options(), call ext4_fc_free() instead of kfree() directly when freeing allocated ext4_fs_context memory after on-disk mount-option processing fails.
Event History
Frequently Asked Questions
What is the severity of CVE-2022-49408?
CVE-2022-49408 has a moderate severity as it involves a memory leak in the Linux kernel's ext4 filesystem.
How do I fix CVE-2022-49408?
To fix CVE-2022-49408, update your Linux kernel to a version that is not affected, specifically beyond 5.17.14 or 5.18.3.
Which versions of the Linux kernel are affected by CVE-2022-49408?
CVE-2022-49408 affects Linux kernel versions from 5.17 up to 5.17.14 and 5.18 up to 5.18.3.
What component of the Linux kernel is impacted by CVE-2022-49408?
CVE-2022-49408 impacts the ext4 filesystem, specifically in the parse_apply_sb_mount_options function.
Is CVE-2022-49408 a remote vulnerability?
CVE-2022-49408 is not classified as a remote vulnerability; it requires local access to the kernel.