In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to trigger foreground gc during f2fsmapblocks() in lfs mode
w/ "mode=lfs" mount option, generic/299 will cause system panic as below:
------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:2835! Call Trace: <TASK> f2fsallocatedatablock+0x6f4/0xc50 f2fsmapblocks+0x970/0x1550 f2fsiomapbegin+0xb2/0x1e0 iomapiter+0x1d6/0x430 _iomapdiorw+0x208/0x9a0 f2fsfilewriteiter+0x6b3/0xfa0 aiowrite+0x15d/0x2e0 iosubmitone+0x55e/0xab0 _x64sysiosubmit+0xa5/0x230 dosyscall64+0x84/0x2f0 entrySYSCALL64afterhwframe+0x76/0x7e RIP: 0010:newcurseg+0x70f/0x720
The root cause of we run out-of-space is: in f2fsmapblocks(), f2fs may trigger foreground gc only if it allocates any physical block, it will be a little bit later when there is multiple threads writing data w/ aio/dio/bufio method in parallel, since we always use OPU in lfs mode, so f2fsmapblocks() does block allocations aggressively.
In order to fix this issue, let's give a chance to trigger foreground gc in prior to block allocation in f2fsmapblocks().
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@264ede8a52f18647ed5bb5f2bd9bf54f556ad8f5",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"178796174568205688714745866772724001725",
"65808873839083493772691547766735875491",
"33944429725963149484931136942269923037",
"168824869178136195781043173281374981164",
"101706197067608806120388029326308463897"
]
},
"id": "CVE-2025-38626-1c706976",
"signature_version": "v1",
"target": {
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1005a3ca28e90c7a64fa43023f866b960a60f791",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"178796174568205688714745866772724001725",
"65808873839083493772691547766735875491",
"33944429725963149484931136942269923037",
"168824869178136195781043173281374981164",
"101706197067608806120388029326308463897"
]
},
"id": "CVE-2025-38626-2eaaa8b9",
"signature_version": "v1",
"target": {
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@264ede8a52f18647ed5bb5f2bd9bf54f556ad8f5",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "281774527745248799093619575831959508731",
"length": 5020.0
},
"id": "CVE-2025-38626-2f3f4968",
"signature_version": "v1",
"target": {
"function": "f2fs_map_blocks",
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@82765ce5c7a56f9309ee45328e763610eaf11253",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "281774527745248799093619575831959508731",
"length": 5020.0
},
"id": "CVE-2025-38626-4a54b9ae",
"signature_version": "v1",
"target": {
"function": "f2fs_map_blocks",
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@385e64a0744584397b4b52b27c96703516f39968",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "259292847230745259973947737125437383724",
"length": 5031.0
},
"id": "CVE-2025-38626-4b505710",
"signature_version": "v1",
"target": {
"function": "f2fs_map_blocks",
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@82765ce5c7a56f9309ee45328e763610eaf11253",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"178796174568205688714745866772724001725",
"65808873839083493772691547766735875491",
"33944429725963149484931136942269923037",
"168824869178136195781043173281374981164",
"101706197067608806120388029326308463897"
]
},
"id": "CVE-2025-38626-514bf05e",
"signature_version": "v1",
"target": {
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@385e64a0744584397b4b52b27c96703516f39968",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"178796174568205688714745866772724001725",
"65808873839083493772691547766735875491",
"33944429725963149484931136942269923037",
"168824869178136195781043173281374981164",
"101706197067608806120388029326308463897"
]
},
"id": "CVE-2025-38626-6137913b",
"signature_version": "v1",
"target": {
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1005a3ca28e90c7a64fa43023f866b960a60f791",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "260512324604477450838865254409141788505",
"length": 5086.0
},
"id": "CVE-2025-38626-c7cb0d2d",
"signature_version": "v1",
"target": {
"function": "f2fs_map_blocks",
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f289690f50a01c3e085d87853392d5b7436a4cee",
"deprecated": false,
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"178796174568205688714745866772724001725",
"65808873839083493772691547766735875491",
"33944429725963149484931136942269923037",
"168824869178136195781043173281374981164",
"101706197067608806120388029326308463897"
]
},
"id": "CVE-2025-38626-c910295c",
"signature_version": "v1",
"target": {
"file": "fs/f2fs/data.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f289690f50a01c3e085d87853392d5b7436a4cee",
"deprecated": false,
"signature_type": "Function",
"digest": {
"function_hash": "113211880453346783435161286976595931468",
"length": 4891.0
},
"id": "CVE-2025-38626-f7392b3b",
"signature_version": "v1",
"target": {
"function": "f2fs_map_blocks",
"file": "fs/f2fs/data.c"
}
}
]