In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to don't panic system for no free segment fault injection
f2fs: fix to don't panic system for no free segment fault injection
syzbot reports a f2fs bug as below:
F2FS-fs (loop0): inject no free segment in getnewsegment of _allocatenewsegment+0x1ce/0x940 fs/f2fs/segment.c:3167 F2FS-fs (loop0): Stopped filesystem due to reason: 7 ------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.c:2748! CPU: 0 UID: 0 PID: 5109 Comm: syz-executor304 Not tainted 6.11.0-rc6-syzkaller-00363-g89f5e14d05b4 #0 RIP: 0010:getnewsegment fs/f2fs/segment.c:2748 [inline] RIP: 0010:newcurseg+0x1f61/0x1f70 fs/f2fs/segment.c:2836 Call Trace: _allocatenewsegment+0x1ce/0x940 fs/f2fs/segment.c:3167 f2fsallocatenewsection fs/f2fs/segment.c:3181 [inline] f2fsallocatepinningsection+0xfa/0x4e0 fs/f2fs/segment.c:3195 f2fsexpandinodedata+0x5d6/0xbb0 fs/f2fs/file.c:1799 f2fsfallocate+0x448/0x960 fs/f2fs/file.c:1903 vfsfallocate+0x553/0x6c0 fs/open.c:334 dovfsioctl+0x2592/0x2e50 fs/ioctl.c:886 _dosysioctl fs/ioctl.c:905 [inline] _sesysioctl+0x81/0x170 fs/ioctl.c:893 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xf3/0x230 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f RIP: 0010:getnewsegment fs/f2fs/segment.c:2748 [inline] RIP: 0010:new_curseg+0x1f61/0x1f70 fs/f2fs/segment.c:2836
The root cause is when we inject no free segment fault into f2fs, we should not panic system, fix it.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f6e7a0512a57387d36f5e9e9635d6668cac13dd",
"id": "CVE-2024-49887-00a8be50",
"digest": {
"function_hash": "97447086204862984742509951329393794633",
"length": 2440.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"file": "fs/f2fs/segment.c",
"function": "get_new_segment"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65a6ce4726c27b45600303f06496fef46d00b57f",
"id": "CVE-2024-49887-0fda0f10",
"digest": {
"line_hashes": [
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"161258282428708258104725854792155933592",
"283404286715539710096326307717443941739",
"186107615001083005084060867212346725656",
"57069574899649533582904008793463344639",
"50361335945086393559254196604896666752",
"245836521105286224942493888354583484186",
"193354860016271729923488451500563710129"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65a6ce4726c27b45600303f06496fef46d00b57f",
"id": "CVE-2024-49887-1a9c9da6",
"digest": {
"function_hash": "97447086204862984742509951329393794633",
"length": 2440.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"file": "fs/f2fs/segment.c",
"function": "get_new_segment"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@645ec43760e86d3079fee2e8b51fde7060a540d0",
"id": "CVE-2024-49887-747f81b0",
"digest": {
"line_hashes": [
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"161258282428708258104725854792155933592",
"283404286715539710096326307717443941739",
"186107615001083005084060867212346725656",
"57069574899649533582904008793463344639",
"50361335945086393559254196604896666752",
"245836521105286224942493888354583484186",
"193354860016271729923488451500563710129"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/f2fs/segment.c"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@645ec43760e86d3079fee2e8b51fde7060a540d0",
"id": "CVE-2024-49887-aa78859e",
"digest": {
"function_hash": "97447086204862984742509951329393794633",
"length": 2440.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function",
"target": {
"file": "fs/f2fs/segment.c",
"function": "get_new_segment"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9f6e7a0512a57387d36f5e9e9635d6668cac13dd",
"id": "CVE-2024-49887-c7a26f03",
"digest": {
"line_hashes": [
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"335604503574366986907964350946482573359",
"117695712525960443475609130444827818544",
"330707481773308409548283547791752242909",
"195676332035140356739823230354426613677",
"161258282428708258104725854792155933592",
"283404286715539710096326307717443941739",
"186107615001083005084060867212346725656",
"57069574899649533582904008793463344639",
"50361335945086393559254196604896666752",
"245836521105286224942493888354583484186",
"193354860016271729923488451500563710129"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line",
"target": {
"file": "fs/f2fs/segment.c"
}
}
]