CVE-2025-22123 (GCVE-0-2025-22123)
Vulnerability from cvelistv5
Published
2025-04-16 14:13
Modified
2025-06-10 11:33
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix to avoid accessing uninitialized curseg
syzbot reports a f2fs bug as below:
F2FS-fs (loop3): Stopped filesystem due to reason: 7
kworker/u8:7: attempt to access beyond end of device
BUG: unable to handle page fault for address: ffffed1604ea3dfa
RIP: 0010:get_ckpt_valid_blocks fs/f2fs/segment.h:361 [inline]
RIP: 0010:has_curseg_enough_space fs/f2fs/segment.h:570 [inline]
RIP: 0010:__get_secs_required fs/f2fs/segment.h:620 [inline]
RIP: 0010:has_not_enough_free_secs fs/f2fs/segment.h:633 [inline]
RIP: 0010:has_enough_free_secs+0x575/0x1660 fs/f2fs/segment.h:649
<TASK>
f2fs_is_checkpoint_ready fs/f2fs/segment.h:671 [inline]
f2fs_write_inode+0x425/0x540 fs/f2fs/inode.c:791
write_inode fs/fs-writeback.c:1525 [inline]
__writeback_single_inode+0x708/0x10d0 fs/fs-writeback.c:1745
writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976
wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156
wb_do_writeback fs/fs-writeback.c:2303 [inline]
wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
worker_thread+0x870/0xd30 kernel/workqueue.c:3398
kthread+0x7a9/0x920 kernel/kthread.c:464
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Commit 8b10d3653735 ("f2fs: introduce FAULT_NO_SEGMENT") allows to trigger
no free segment fault in allocator, then it will update curseg->segno to
NULL_SEGNO, though, CP_ERROR_FLAG has been set, f2fs_write_inode() missed
to check the flag, and access invalid curseg->segno directly in below call
path, then resulting in panic:
- f2fs_write_inode
- f2fs_is_checkpoint_ready
- has_enough_free_secs
- has_not_enough_free_secs
- __get_secs_required
- has_curseg_enough_space
- get_ckpt_valid_blocks
: access invalid curseg->segno
To avoid this issue, let's:
- check CP_ERROR_FLAG flag in prior to f2fs_is_checkpoint_ready() in
f2fs_write_inode().
- in has_curseg_enough_space(), save curseg->segno into a temp variable,
and verify its validation before use.
References
Impacted products
{ "containers": { "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "fs/f2fs/inode.c", "fs/f2fs/segment.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "bf49527089ec1ba894c6e587affabbfb2329f52e", "status": "affected", "version": "8b10d3653735e117bc1954ade80d75ad7b46b801", "versionType": "git" }, { "lessThan": "7f90e5d423cd2d4c74b2abb527872f335108637f", "status": "affected", "version": "8b10d3653735e117bc1954ade80d75ad7b46b801", "versionType": "git" }, { "lessThan": "986c50f6bca109c6cf362b4e2babcb85aba958f6", "status": "affected", "version": "8b10d3653735e117bc1954ade80d75ad7b46b801", "versionType": "git" } ] }, { "defaultStatus": "affected", "product": "Linux", "programFiles": [ "fs/f2fs/inode.c", "fs/f2fs/segment.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "status": "affected", "version": "6.9" }, { "lessThan": "6.9", "status": "unaffected", "version": "0", "versionType": "semver" }, { "lessThanOrEqual": "6.12.*", "status": "unaffected", "version": "6.12.33", "versionType": "semver" }, { "lessThanOrEqual": "6.14.*", "status": "unaffected", "version": "6.14.2", "versionType": "semver" }, { "lessThanOrEqual": "*", "status": "unaffected", "version": "6.15", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "cpeMatch": [ { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.12.33", "versionStartIncluding": "6.9", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.14.2", "versionStartIncluding": "6.9", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.15", "versionStartIncluding": "6.9", "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 accessing uninitialized curseg\n\nsyzbot reports a f2fs bug as below:\n\nF2FS-fs (loop3): Stopped filesystem due to reason: 7\nkworker/u8:7: attempt to access beyond end of device\nBUG: unable to handle page fault for address: ffffed1604ea3dfa\nRIP: 0010:get_ckpt_valid_blocks fs/f2fs/segment.h:361 [inline]\nRIP: 0010:has_curseg_enough_space fs/f2fs/segment.h:570 [inline]\nRIP: 0010:__get_secs_required fs/f2fs/segment.h:620 [inline]\nRIP: 0010:has_not_enough_free_secs fs/f2fs/segment.h:633 [inline]\nRIP: 0010:has_enough_free_secs+0x575/0x1660 fs/f2fs/segment.h:649\n \u003cTASK\u003e\n f2fs_is_checkpoint_ready fs/f2fs/segment.h:671 [inline]\n f2fs_write_inode+0x425/0x540 fs/f2fs/inode.c:791\n write_inode fs/fs-writeback.c:1525 [inline]\n __writeback_single_inode+0x708/0x10d0 fs/fs-writeback.c:1745\n writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976\n wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156\n wb_do_writeback fs/fs-writeback.c:2303 [inline]\n wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343\n process_one_work kernel/workqueue.c:3236 [inline]\n process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317\n worker_thread+0x870/0xd30 kernel/workqueue.c:3398\n kthread+0x7a9/0x920 kernel/kthread.c:464\n ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148\n ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244\n\nCommit 8b10d3653735 (\"f2fs: introduce FAULT_NO_SEGMENT\") allows to trigger\nno free segment fault in allocator, then it will update curseg-\u003esegno to\nNULL_SEGNO, though, CP_ERROR_FLAG has been set, f2fs_write_inode() missed\nto check the flag, and access invalid curseg-\u003esegno directly in below call\npath, then resulting in panic:\n\n- f2fs_write_inode\n - f2fs_is_checkpoint_ready\n - has_enough_free_secs\n - has_not_enough_free_secs\n - __get_secs_required\n - has_curseg_enough_space\n - get_ckpt_valid_blocks\n : access invalid curseg-\u003esegno\n\nTo avoid this issue, let\u0027s:\n- check CP_ERROR_FLAG flag in prior to f2fs_is_checkpoint_ready() in\nf2fs_write_inode().\n- in has_curseg_enough_space(), save curseg-\u003esegno into a temp variable,\nand verify its validation before use." } ], "providerMetadata": { "dateUpdated": "2025-06-10T11:33:23.410Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/bf49527089ec1ba894c6e587affabbfb2329f52e" }, { "url": "https://git.kernel.org/stable/c/7f90e5d423cd2d4c74b2abb527872f335108637f" }, { "url": "https://git.kernel.org/stable/c/986c50f6bca109c6cf362b4e2babcb85aba958f6" } ], "title": "f2fs: fix to avoid accessing uninitialized curseg", "x_generator": { "engine": "bippy-1.2.0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2025-22123", "datePublished": "2025-04-16T14:13:07.213Z", "dateReserved": "2024-12-29T08:45:45.823Z", "dateUpdated": "2025-06-10T11:33:23.410Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "vulnerability-lookup:meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2025-22123\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-04-16T15:16:06.450\",\"lastModified\":\"2025-06-10T12:15:23.750\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nf2fs: fix to avoid accessing uninitialized curseg\\n\\nsyzbot reports a f2fs bug as below:\\n\\nF2FS-fs (loop3): Stopped filesystem due to reason: 7\\nkworker/u8:7: attempt to access beyond end of device\\nBUG: unable to handle page fault for address: ffffed1604ea3dfa\\nRIP: 0010:get_ckpt_valid_blocks fs/f2fs/segment.h:361 [inline]\\nRIP: 0010:has_curseg_enough_space fs/f2fs/segment.h:570 [inline]\\nRIP: 0010:__get_secs_required fs/f2fs/segment.h:620 [inline]\\nRIP: 0010:has_not_enough_free_secs fs/f2fs/segment.h:633 [inline]\\nRIP: 0010:has_enough_free_secs+0x575/0x1660 fs/f2fs/segment.h:649\\n \u003cTASK\u003e\\n f2fs_is_checkpoint_ready fs/f2fs/segment.h:671 [inline]\\n f2fs_write_inode+0x425/0x540 fs/f2fs/inode.c:791\\n write_inode fs/fs-writeback.c:1525 [inline]\\n __writeback_single_inode+0x708/0x10d0 fs/fs-writeback.c:1745\\n writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976\\n wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156\\n wb_do_writeback fs/fs-writeback.c:2303 [inline]\\n wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343\\n process_one_work kernel/workqueue.c:3236 [inline]\\n process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317\\n worker_thread+0x870/0xd30 kernel/workqueue.c:3398\\n kthread+0x7a9/0x920 kernel/kthread.c:464\\n ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148\\n ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244\\n\\nCommit 8b10d3653735 (\\\"f2fs: introduce FAULT_NO_SEGMENT\\\") allows to trigger\\nno free segment fault in allocator, then it will update curseg-\u003esegno to\\nNULL_SEGNO, though, CP_ERROR_FLAG has been set, f2fs_write_inode() missed\\nto check the flag, and access invalid curseg-\u003esegno directly in below call\\npath, then resulting in panic:\\n\\n- f2fs_write_inode\\n - f2fs_is_checkpoint_ready\\n - has_enough_free_secs\\n - has_not_enough_free_secs\\n - __get_secs_required\\n - has_curseg_enough_space\\n - get_ckpt_valid_blocks\\n : access invalid curseg-\u003esegno\\n\\nTo avoid this issue, let\u0027s:\\n- check CP_ERROR_FLAG flag in prior to f2fs_is_checkpoint_ready() in\\nf2fs_write_inode().\\n- in has_curseg_enough_space(), save curseg-\u003esegno into a temp variable,\\nand verify its validation before use.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: f2fs: correcci\u00f3n para evitar el acceso a curseg no inicializado syzbot informa un error de f2fs como el siguiente: F2FS-fs (loop3): sistema de archivos detenido por el motivo: 7 kworker/u8:7: intento de acceso m\u00e1s all\u00e1 del final del dispositivo ERROR: no se puede controlar el error de p\u00e1gina para la direcci\u00f3n: ffffed1604ea3dfa RIP: 0010:has_curseg_enough_space fs/f2fs/segment.h:570 [inline] RIP: 0010:__get_secs_required fs/f2fs/segment.h:620 [inline] RIP: 0010:has_not_enough_free_secs fs/f2fs/segment.h:633 [inline] RIP: 0010:has_enough_free_secs+0x575/0x1660 fs/f2fs/segment.h:649 f2fs_is_checkpoint_ready fs/f2fs/segment.h:671 [inline] f2fs_write_inode+0x425/0x540 fs/f2fs/inode.c:791 write_inode fs/fs-writeback.c:1525 [inline] __writeback_single_inode+0x708/0x10d0 fs/fs-writeback.c:1745 writeback_sb_inodes+0x820/0x1360 fs/fs-writeback.c:1976 wb_writeback+0x413/0xb80 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x410/0x1080 fs/fs-writeback.c:2343 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317 worker_thread+0x870/0xd30 kernel/workqueue.c:3398 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Commit 8b10d3653735 (\\\"f2fs: introduce FAULT_NO_SEGMENT\\\") permite que no se active ninguna falla de segmento libre en el asignador, luego se actualizar\u00e1 curseg-\u0026gt;segno to NULL_SEGNO, though, CP_ERROR_FLAG has been set, f2fs_write_inode() No se pudo verificar la bandera y el acceso no es v\u00e1lido curseg-\u0026gt;segno directly En la siguiente ruta de llamada, lo que genera p\u00e1nico: - f2fs_write_inode - f2fs_is_checkpoint_ready - has_enough_free_secs - has_not_enough_free_secs - __get_secs_required - has_curseg_enough_space - get_ckpt_valid_blocks : access invalid curseg-\u0026gt;segno Para evitar este problema, vamos a: - check CP_ERROR_FLAG flag in prior to f2fs_is_checkpoint_ready() in f2fs_write_inode(). - in has_curseg_enough_space(), save curseg-\u0026gt;segno en una variable temporal y verificar su validaci\u00f3n antes de usar.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/7f90e5d423cd2d4c74b2abb527872f335108637f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/986c50f6bca109c6cf362b4e2babcb85aba958f6\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bf49527089ec1ba894c6e587affabbfb2329f52e\",\"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.
- 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…