Skip to content
Medium 4.1

f2fs: fix to invalidate curseg if change_curseg() fails

CVE-2026-99570 First seen on SecPulse

Affected packages

PackageAffected → Fixed
LinuxLinux —
LinuxKernel
≥ 5.4.75, < 5.5→ 5.5
≥ 5.9.5, < 5.10→ 5.10
≥ 5.10.0, < 6.12.118→ 6.12.118
≥ 6.13.0, < 6.18.64→ 6.18.64
≥ 6.19.0, < 7.3.5→ 7.3.5

Fix status by distribution

Records published by each distribution for this CVE. Fixed versions differ by release; check each link.

Original description The description as published by the source.

In the Linux kernel, the following vulnerability has been resolved:

f2fs: fix to invalidate curseg if change_curseg() fails

Our consistency stress test (fsstress + fio + atomic write workers +
"f2fs_io shutdown 1") triggers below kernel BUG:

F2FS-fs (vdd): Stopped filesystem due to reason: 0
------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:3989!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
Workqueue: writeback wb_workfn (flush-253:48)
RIP: 0010:f2fs_allocate_data_block+0x257a/0x38e0
Call Trace:

do_write_block+0x155/0xc10
f2fs_outplace_write_data+0x192/0x340
f2fs_do_write_data_page+0xc57/0x1880
f2fs_write_single_data_page+0xda9/0x15a0
f2fs_write_cache_pages+0x973/0x1f20
__f2fs_write_data_pages+0x6c4/0x1890
do_writepages+0x21e/0x560
__writeback_single_inode+0x119/0x11b0
writeback_sb_inodes+0x67d/0x17a0
wb_writeback+0x207/0x820
wb_workfn+0x128/0xc30
process_one_work+0x925/0x1600
worker_thread+0x60a/0xff0
kthread+0x35f/0x460
ret_from_fork+0x474/0x7e0
ret_from_fork_asm+0x1a/0x30

The BUG is f2fs_bug_on(sbi, curseg->next_blkoff >= BLKS_PER_SEG(sbi))
in f2fs_allocate_data_block(), next_blkoff was 512.

The root cause is a race in between atomic write commit and shutdown
as below:

Thread A (commit atomic write) Thread B (shutdown) Thread C (writeback)

  • f2fs_ioc_commit_atomic_write
  • f2fs_commit_atomic_write
  • __f2fs_commit_atomic_write
  • __replace_atomic_write_block
    - f2fs_replace_block
    • __…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details