f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count()
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215897 I have encountered a bug in F2FS file system in kernel v5.17. The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can reproduce the bug by running the following commands: The kernel message is shown below: kernel BUG at fs/f2fs/f2fs.h:2511! Call Trace: f2fs_remove_inode_page+0x2a2/0x830 f2fs_evict_inode+0x9b7/0x1510 evict+0x282/0x4e0 do_unlinkat+0x33a/0x540 __x64_sys_unlinkat+0x8e/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is: .total_valid_block_count or .total_valid_node_count could fuzzed to zero, then once dec_valid_node_count() was called, it will cause BUG_ON(), this patch fixes to print warning info and set SBI_NEED_FSCK into CP instead of panic.
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.121, 5.15.46, 5.17.14, 5.18.3, 5.4.198
- CVEs
- CVE-2022-49380
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 23:22 UTC · Revision 1
Source evidence
f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count()
core-osv · Original sourcePublished 26 Feb 2025, 02:11 UTC
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215897 I have encountered a bug in F2FS file system in kernel v5.17. The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can reproduce the bug by running the following commands: The kernel message is shown below: kernel BUG at fs/f2fs/f2fs.h:2511! Call Trace: f2fs_remove_inode_page+0x2a2/0x830 f2fs_evict_inode+0x9b7/0x1510 evict+0x282/0x4e0 do_unlinkat+0x33a/0x540 __x64_sys_unlinkat+0x8e/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is: .total_valid_block_count or .total_valid_node_count could fuzzed to zero, then once dec_valid_node_count() was called, it will cause BUG_ON(), this patch fixes to print warning info and set SBI_NEED_FSCK into CP instead of panic.
osv:CVE-2022-49380
Kernel
Fixed versions: 5.4.198, 5.10.121, 5.15.46, 5.17.14, 5.18.3
Complete source record
{
"id": "761b92df56f0c580f43def0debd912f73ec2185f0ec5f0b762db2bcd465e8e0c",
"url": "https://osv.dev/vulnerability/CVE-2022-49380",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count()",
"summary": "In the Linux kernel, the following vulnerability has been resolved: f2fs: fix to avoid f2fs_bug_on() in dec_valid_node_count() As Yanming reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215897 I have encountered a bug in F2FS file system in kernel v5.17. The kernel should enable CONFIG_KASAN=y and CONFIG_KASAN_INLINE=y. You can reproduce the bug by running the following commands: The kernel message is shown below: kernel BUG at fs/f2fs/f2fs.h:2511! Call Trace: f2fs_remove_inode_page+0x2a2/0x830 f2fs_evict_inode+0x9b7/0x1510 evict+0x282/0x4e0 do_unlinkat+0x33a/0x540 __x64_sys_unlinkat+0x8e/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is: .total_valid_block_count or .total_valid_node_count could fuzzed to zero, then once dec_valid_node_count() was called, it will cause BUG_ON(), this patch fixes to print warning info and set SBI_NEED_FSCK into CP instead of panic.",
"evidence": "osv:CVE-2022-49380",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.4.198",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.121",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.46",
"evidence": "/affected/1/ranges"
},
{
"value": "5.17.14",
"evidence": "/affected/1/ranges"
},
{
"value": "5.18.3",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2022-49380",
"aliases": [
"CVE-2022-49380"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5"
},
{
"fixed": "f8b3c3fcf33105bc1ee7788e3b51b0a1ae42ae53"
},
{
"fixed": "2766ddaf45b69252bb8fe526b5b6e56904a9ae7a"
},
{
"fixed": "bce859358d3d5940aa858e40ceee70ee6e76130e"
},
{
"fixed": "89d9a48d0cd30429463ea4e37ca83be6773ed5eb"
},
{
"fixed": "ccffa99ae6a1f44797b57444c6a80382a42928fe"
},
{
"fixed": "4d17e6fe9293d57081ffdc11e1cf313e25e8fd9e"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49380.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "3.8.0"
},
{
"fixed": "5.4.198"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.121"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.46"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "5.17.14"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.18.0"
},
{
"fixed": "5.18.3"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49380.json"
}
}
],
"modified": "2026-10-28T02:30:24.273646195Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/2766ddaf45b69252bb8fe526b5b6e56904a9ae7a",
"https://git.kernel.org/stable/c/4d17e6fe9293d57081ffdc11e1cf313e25e8fd9e",
"https://git.kernel.org/stable/c/89d9a48d0cd30429463ea4e37ca83be6773ed5eb",
"https://git.kernel.org/stable/c/bce859358d3d5940aa858e40ceee70ee6e76130e",
"https://git.kernel.org/stable/c/ccffa99ae6a1f44797b57444c6a80382a42928fe",
"https://git.kernel.org/stable/c/f8b3c3fcf33105bc1ee7788e3b51b0a1ae42ae53",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49380.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-49380",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49380.json"
}
},
"related_cves": [
{
"value": "CVE-2022-49380",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 490843,
"published_at": "2025-02-26T02:11:18.314+00:00"
}