CVE-2022-50334

Severity CVSS v4.0:
Pending analysis
Type:
CWE-476 NULL Pointer Dereference
Publication date:
15/09/2025
Last modified:
04/12/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> hugetlbfs: fix null-ptr-deref in hugetlbfs_parse_param()<br /> <br /> Syzkaller reports a null-ptr-deref bug as follows:<br /> ======================================================<br /> KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]<br /> RIP: 0010:hugetlbfs_parse_param+0x1dd/0x8e0 fs/hugetlbfs/inode.c:1380<br /> [...]<br /> Call Trace:<br /> <br /> vfs_parse_fs_param fs/fs_context.c:148 [inline]<br /> vfs_parse_fs_param+0x1f9/0x3c0 fs/fs_context.c:129<br /> vfs_parse_fs_string+0xdb/0x170 fs/fs_context.c:191<br /> generic_parse_monolithic+0x16f/0x1f0 fs/fs_context.c:231<br /> do_new_mount fs/namespace.c:3036 [inline]<br /> path_mount+0x12de/0x1e20 fs/namespace.c:3370<br /> do_mount fs/namespace.c:3383 [inline]<br /> __do_sys_mount fs/namespace.c:3591 [inline]<br /> __se_sys_mount fs/namespace.c:3568 [inline]<br /> __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568<br /> do_syscall_x64 arch/x86/entry/common.c:50 [inline]<br /> do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80<br /> entry_SYSCALL_64_after_hwframe+0x63/0xcd<br /> [...]<br /> <br /> ======================================================<br /> <br /> According to commit "vfs: parse: deal with zero length string value",<br /> kernel will set the param-&gt;string to null pointer in vfs_parse_fs_string()<br /> if fs string has zero length.<br /> <br /> Yet the problem is that, hugetlbfs_parse_param() will dereference the<br /> param-&gt;string, without checking whether it is a null pointer. To be more<br /> specific, if hugetlbfs_parse_param() parses an illegal mount parameter,<br /> such as "size=,", kernel will constructs struct fs_parameter with null<br /> pointer in vfs_parse_fs_string(), then passes this struct fs_parameter to<br /> hugetlbfs_parse_param(), which triggers the above null-ptr-deref bug.<br /> <br /> This patch solves it by adding sanity check on param-&gt;string<br /> in hugetlbfs_parse_param().

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.4.229 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.163 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.86 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.0.16 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.1 (including) 6.1.2 (excluding)