CVE-2025-40138 (GCVE-0-2025-40138)
Vulnerability from cvelistv5
Published
2025-11-12 10:23
Modified
2025-11-12 10:23
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid NULL pointer dereference in f2fs_check_quota_consistency()
syzbot reported a f2fs bug as below:
Oops: gen[ 107.736417][ T5848] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 UID: 0 PID: 5848 Comm: syz-executor263 Tainted: G W 6.17.0-rc1-syzkaller-00014-g0e39a731820a #0 PREEMPT_{RT,(full)}
RIP: 0010:strcmp+0x3c/0xc0 lib/string.c:284
Call Trace:
<TASK>
f2fs_check_quota_consistency fs/f2fs/super.c:1188 [inline]
f2fs_check_opt_consistency+0x1378/0x2c10 fs/f2fs/super.c:1436
__f2fs_remount fs/f2fs/super.c:2653 [inline]
f2fs_reconfigure+0x482/0x1770 fs/f2fs/super.c:5297
reconfigure_super+0x224/0x890 fs/super.c:1077
do_remount fs/namespace.c:3314 [inline]
path_mount+0xd18/0xfe0 fs/namespace.c:4112
do_mount fs/namespace.c:4133 [inline]
__do_sys_mount fs/namespace.c:4344 [inline]
__se_sys_mount+0x317/0x410 fs/namespace.c:4321
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The direct reason is f2fs_check_quota_consistency() may suffer null-ptr-deref
issue in strcmp().
The bug can be reproduced w/ below scripts:
mkfs.f2fs -f /dev/vdb
mount -t f2fs -o usrquota /dev/vdb /mnt/f2fs
quotacheck -uc /mnt/f2fs/
umount /mnt/f2fs
mount -t f2fs -o usrjquota=aquota.user,jqfmt=vfsold /dev/vdb /mnt/f2fs
mount -t f2fs -o remount,usrjquota=,jqfmt=vfsold /dev/vdb /mnt/f2fs
umount /mnt/f2fs
So, before old_qname and new_qname comparison, we need to check whether
they are all valid pointers, fix it.
References
Impacted products
{
"containers": {
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Linux",
"programFiles": [
"fs/f2fs/super.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"lessThan": "3f3458852bbfe79c60f2412b8b04677b96688b6e",
"status": "affected",
"version": "d185351325237da688de006a2c579e82ea97bdfe",
"versionType": "git"
},
{
"lessThan": "930a9a6ee8e7ffa20af4bffbfc2bbd21d83bf81c",
"status": "affected",
"version": "d185351325237da688de006a2c579e82ea97bdfe",
"versionType": "git"
}
]
},
{
"defaultStatus": "affected",
"product": "Linux",
"programFiles": [
"fs/f2fs/super.c"
],
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"versions": [
{
"status": "affected",
"version": "6.17"
},
{
"lessThan": "6.17",
"status": "unaffected",
"version": "0",
"versionType": "semver"
},
{
"lessThanOrEqual": "6.17.*",
"status": "unaffected",
"version": "6.17.3",
"versionType": "semver"
},
{
"lessThanOrEqual": "*",
"status": "unaffected",
"version": "6.18-rc1",
"versionType": "original_commit_for_fix"
}
]
}
],
"cpeApplicability": [
{
"nodes": [
{
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.17.3",
"versionStartIncluding": "6.17",
"vulnerable": true
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"versionEndExcluding": "6.18-rc1",
"versionStartIncluding": "6.17",
"vulnerable": true
}
],
"negate": false,
"operator": "OR"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nf2fs: fix to avoid NULL pointer dereference in f2fs_check_quota_consistency()\n\nsyzbot reported a f2fs bug as below:\n\nOops: gen[ 107.736417][ T5848] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI\nKASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\nCPU: 1 UID: 0 PID: 5848 Comm: syz-executor263 Tainted: G W 6.17.0-rc1-syzkaller-00014-g0e39a731820a #0 PREEMPT_{RT,(full)}\nRIP: 0010:strcmp+0x3c/0xc0 lib/string.c:284\nCall Trace:\n \u003cTASK\u003e\n f2fs_check_quota_consistency fs/f2fs/super.c:1188 [inline]\n f2fs_check_opt_consistency+0x1378/0x2c10 fs/f2fs/super.c:1436\n __f2fs_remount fs/f2fs/super.c:2653 [inline]\n f2fs_reconfigure+0x482/0x1770 fs/f2fs/super.c:5297\n reconfigure_super+0x224/0x890 fs/super.c:1077\n do_remount fs/namespace.c:3314 [inline]\n path_mount+0xd18/0xfe0 fs/namespace.c:4112\n do_mount fs/namespace.c:4133 [inline]\n __do_sys_mount fs/namespace.c:4344 [inline]\n __se_sys_mount+0x317/0x410 fs/namespace.c:4321\n do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\n do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\nThe direct reason is f2fs_check_quota_consistency() may suffer null-ptr-deref\nissue in strcmp().\n\nThe bug can be reproduced w/ below scripts:\nmkfs.f2fs -f /dev/vdb\nmount -t f2fs -o usrquota /dev/vdb /mnt/f2fs\nquotacheck -uc /mnt/f2fs/\numount /mnt/f2fs\nmount -t f2fs -o usrjquota=aquota.user,jqfmt=vfsold /dev/vdb /mnt/f2fs\nmount -t f2fs -o remount,usrjquota=,jqfmt=vfsold /dev/vdb /mnt/f2fs\numount /mnt/f2fs\n\nSo, before old_qname and new_qname comparison, we need to check whether\nthey are all valid pointers, fix it."
}
],
"providerMetadata": {
"dateUpdated": "2025-11-12T10:23:23.912Z",
"orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"shortName": "Linux"
},
"references": [
{
"url": "https://git.kernel.org/stable/c/3f3458852bbfe79c60f2412b8b04677b96688b6e"
},
{
"url": "https://git.kernel.org/stable/c/930a9a6ee8e7ffa20af4bffbfc2bbd21d83bf81c"
}
],
"title": "f2fs: fix to avoid NULL pointer dereference in f2fs_check_quota_consistency()",
"x_generator": {
"engine": "bippy-1.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"assignerShortName": "Linux",
"cveId": "CVE-2025-40138",
"datePublished": "2025-11-12T10:23:23.912Z",
"dateReserved": "2025-04-16T07:20:57.171Z",
"dateUpdated": "2025-11-12T10:23:23.912Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"nvd": "{\"cve\":{\"id\":\"CVE-2025-40138\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-11-12T11:15:43.553\",\"lastModified\":\"2025-11-12T16:19:12.850\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nf2fs: fix to avoid NULL pointer dereference in f2fs_check_quota_consistency()\\n\\nsyzbot reported a f2fs bug as below:\\n\\nOops: gen[ 107.736417][ T5848] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI\\nKASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]\\nCPU: 1 UID: 0 PID: 5848 Comm: syz-executor263 Tainted: G W 6.17.0-rc1-syzkaller-00014-g0e39a731820a #0 PREEMPT_{RT,(full)}\\nRIP: 0010:strcmp+0x3c/0xc0 lib/string.c:284\\nCall Trace:\\n \u003cTASK\u003e\\n f2fs_check_quota_consistency fs/f2fs/super.c:1188 [inline]\\n f2fs_check_opt_consistency+0x1378/0x2c10 fs/f2fs/super.c:1436\\n __f2fs_remount fs/f2fs/super.c:2653 [inline]\\n f2fs_reconfigure+0x482/0x1770 fs/f2fs/super.c:5297\\n reconfigure_super+0x224/0x890 fs/super.c:1077\\n do_remount fs/namespace.c:3314 [inline]\\n path_mount+0xd18/0xfe0 fs/namespace.c:4112\\n do_mount fs/namespace.c:4133 [inline]\\n __do_sys_mount fs/namespace.c:4344 [inline]\\n __se_sys_mount+0x317/0x410 fs/namespace.c:4321\\n do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]\\n do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94\\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\\n\\nThe direct reason is f2fs_check_quota_consistency() may suffer null-ptr-deref\\nissue in strcmp().\\n\\nThe bug can be reproduced w/ below scripts:\\nmkfs.f2fs -f /dev/vdb\\nmount -t f2fs -o usrquota /dev/vdb /mnt/f2fs\\nquotacheck -uc /mnt/f2fs/\\numount /mnt/f2fs\\nmount -t f2fs -o usrjquota=aquota.user,jqfmt=vfsold /dev/vdb /mnt/f2fs\\nmount -t f2fs -o remount,usrjquota=,jqfmt=vfsold /dev/vdb /mnt/f2fs\\numount /mnt/f2fs\\n\\nSo, before old_qname and new_qname comparison, we need to check whether\\nthey are all valid pointers, fix it.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/3f3458852bbfe79c60f2412b8b04677b96688b6e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/930a9a6ee8e7ffa20af4bffbfc2bbd21d83bf81c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…