AZL-117133: CVE-2026-139438 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
block: use iomapdirtyfolio for block devices
With CONFIGBUFFERHEAD=n, block devices are written back through iomap, but defblkaops uses filemapdirtyfolio, which only sets PGdirty. It does not set the per-block dirty bits in the folio's iomapfoliostate, so iomapwritebackfolio() finds no dirty range, submits no I/O and clears PGdirty, resulting in data loss.
Other iomap users set .dirtyfolio to iomapdirtyfolio, which marks the folio's blocks dirty before calling filemapdirtyfolio().
This is only observable with block size < folio size. With a single block there is no iomapfoliostate to get out of sync and iomapwritebackfolio() marks the whole folio dirty itself. For a page-aligned device, this may require using the BLKBSZSET ioctl to set the block size, which requires CAPSYSADMIN. A device whose size is not page aligned already gets a sub-page block size from setinitblocksize(), so no ioctl and no privilege is needed.
To reproduce, on a device with a sub-page block size, write a known pattern with ODIRECT, mmap the same range, store to it, msync() and fsync(), then read it back with ODIRECT. A reproducer is available at [1].
[1] https://gist.github.com/tzussman/18ab05cba4b3fdc79cce0a69d1fd05b4
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this data-loss condition?
The condition is observable only when the kernel is built with CONFIG_BUFFER_HEAD=n and a block device uses a block size smaller than the folio size. Devices whose size is not page-aligned may already use a sub-page block size; page-aligned devices may need their block size changed with BLKBSZSET.
What does an attacker or local user need to do to trigger the issue?
They need write access to a qualifying block device and must modify a mapped range, then request writeback, such as by writing a known pattern with O_DIRECT, mmaping the same range, storing to it, and calling msync() and fsync(). Changing the block size of a page-aligned device through BLKBSZSET requires CAP_SYS_ADMIN.
How can administrators determine whether the issue is occurring?
On a device with a sub-page block size, write a known pattern with O_DIRECT, modify the same range through an mmap, call msync() and fsync(), and read the range back with O_DIRECT. A mismatch indicates that writeback did not persist the mapped modification.