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->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->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->string<br />
in hugetlbfs_parse_param().
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
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) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/26215b7ee923b9251f7bb12c4e5f09dc465d35f2
- https://git.kernel.org/stable/c/965e8f8ae0f642b5528f5a82b7bcaf15a659d5bd
- https://git.kernel.org/stable/c/9a8862820cbf1f18dca4f3b4c289d88561b3a384
- https://git.kernel.org/stable/c/dcd28191be9bbf307ba51a5b485773a55b0037c4
- https://git.kernel.org/stable/c/f2207145693ae5697a7b59e2add4b92f9e5b0e3c
- https://git.kernel.org/stable/c/fa71639873518e3587632ae58e25e4a96b57fa90



