CVE-2026-99576: f2fs: zone: fix to avoid bio split on sequential zone
In the Linux kernel, the following vulnerability has been resolved:
f2fs: zone: fix to avoid bio split on sequential zone
In the block layer, biosplittolimits() splits a bio if it exceeds any underlying queue limits: 1. queuemaxsectors: Splits bios larger than the transfer limit. This limit is set by the device driver/DMA controller (maxhwsectors) and device-mapper targets. When flushing dirty pages (governed by VFS writebackchunksize() and f2fs nrpagestoskip()), f2fs merges contiguous pages into bios up to 512KB (1024 sectors) or more without checking queuemaxsectors, which will be split if the device or DM target enforces a smaller limit. 2. queuemaxsegments: Splits bios exceeding scatter-gather segment limits. f2fs allocates bios with up to 256 pages, exceeding the 128-segment limit of DM targets (dm-default-key/dm-crypt) if pages are discontiguous. 3. chunksectors: Splits bios crossing chunk/zone boundaries. In f2fs, sectionsize strictly matches zonesize, and block allocation never spans across section boundaries, so bios never cross chunksectors.
Crucially, when biosplittolimits() splits a bio, biosubmitsplit() submits the tail half via submitbionoacct() before returning the head half to the caller. On a sequential zoned device, this causes the tail bio to arrive at the zone write plug before the head:
dm-3: zone 7: preparebio wp mismatch: bio sector 30720 offset 2048 != wpoffset 248, len 248
The write plug rejects the out-of-order tail with BLKSTSIOERR, causing f2fsstopcheckpoint() and remounting the filesystem read-only:
2026-09-30T22:09:23.725678+08:00 localhost kernel: CPU: 9 UID: 0 PID: 243 Comm: kworker/9:1H Not tainted 6.12.81-gb3ef518fb26d #5 2026-09-30T22:09:23.725750+08:00 localhost kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014 2026-09-30T22:09:23.725753+08:00 localhost kernel: Workqueue: dm-3zwplugs blkzonewplugbiowork 2026-09-30T22:09:23.725756+08:00 localhost kernel: Call Trace: 2026-09-30T22:09:23.725758+08:00 localhost kernel: <TASK> 2026-09-30T22:09:23.725758+08:00 localhost kernel: dumpstacklvl+0x4d/0x70 2026-09-30T22:09:23.725759+08:00 localhost kernel: f2fsstopcheckpoint+0x1df/0x5d0 2026-09-30T22:09:23.725759+08:00 localhost kernel: ? blkzonewplugbiowork+0x4eb/0x740 2026-09-30T22:09:23.725760+08:00 localhost kernel: f2fscachewriteendio+0x545/0x6e0 2026-09-30T22:09:23.725761+08:00 localhost kernel: blkzonewplugbiowork+0x4eb/0x740 2026-09-30T22:09:23.725762+08:00 localhost kernel: processonework+0x5c6/0xde0 2026-09-30T22:09:23.725764+08:00 localhost kernel: ? assignwork+0x124/0x4e0 2026-09-30T22:09:23.725765+08:00 localhost kernel: workerthread+0x403/0xb70 2026-09-30T22:09:23.725765+08:00 localhost kernel: ? kthreadparkme+0x82/0x140 2026-09-30T22:09:23.725766+08:00 localhost kernel: ? pfxworkerthread+0x10/0x10 2026-09-30T22:09:23.725766+08:00 localhost kernel: kthread+0x235/0x2e0 2026-09-30T22:09:23.725767+08:00 localhost kernel: ? recalcsigpending+0x128/0x1d0 2026-09-30T22:09:23.725767+08:00 localhost kernel: ? pfxkthread+0x10/0x10 2026-09-30T22:09:23.725769+08:00 localhost kernel: retfromfork+0x2f/0x70 2026-09-30T22:09:23.725769+08:00 localhost kernel: ? pfxkthread+0x10/0x10 2026-09-30T22:09:23.725770+08:00 localhost kernel: retfromforkasm+0x1a/0x30 2026-09-30T22:09:23.725771+08:00 localhost kernel: </TASK> 2026-09-30T22:09:23.725771+08:00 localhost kernel: F2FS-fs (dm-0): Stopped filesystem due to reason: 3
To prevent write bios destined for sequential zones from being split: 1. In bioalloc(), bound npages to bdevmaxsegments(bdev) for writes to sequential zone areas. 2. In pageismergeable(), check queuemaxsegments() and queuemaxsectors() for sequential zone areas, so f2fs will not merge beyond the queue limits.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Compensating control
For writes to sequential-zone areas, bound the number of pages allocated in __bio_alloc() to bdev_max_segments(bdev), and in f2fs page_is_mergeable() check queue_max_segments() and queue_max_sectors() so bios are not merged beyond queue limits.
Frequently Asked Questions
Which storage configurations are most likely to encounter the issue?
F2FS writeback can create bios that exceed an underlying queue's maximum transfer or scatter-gather segment limits. This is particularly relevant where a device driver, DMA controller, or device-mapper target enforces a smaller maximum transfer size, and for dm-default-key or dm-crypt targets with a 128-segment limit when pages are discontiguous.
Are bios crossing zone or chunk boundaries the cause of this problem?
No. F2FS section size strictly matches zone size, and its block allocation does not span section boundaries, so its bios do not cross chunk_sectors boundaries.
What behavior leads to the problematic bio splits?
During dirty-page flushing, F2FS can merge contiguous pages into bios of up to 512 KB (1024 sectors) or more without checking queue_max_sectors. It can also allocate bios for up to 256 pages, which can exceed a target's segment limit when those pages are discontiguous.