bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2026-89772

—unknown

linux6.18.60 · 6.18.54 · 6.18.8in 3 of 4 releases

Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.

Reach linux · 6 builds in 3 of 4 releases

full reviewcross-check✓ a member decided

v25.03.1not in NVD's range
v26.01.06.18.8
v26.09.06.18.54
v26.10.0latest6.18.60
aarch64_minimal
x86_64
aarch64_minimal–
x86_64–
aarch64_minimalAAwaiting reviewx86_64AAwaiting reviewaarch64_minimalOpenx86_64AAwaiting reviewaarch64_minimalAAwaiting reviewx86_64AAwaiting review

Description · NVD

btrfs: write-protect folios during data writeback

commit 095be159f3eb ("btrfs: unify folio dirty flag clearing") replaced the folio_clear_dirty_for_io() call in extent_write_cache_pages() with a plain folio_test_dirty() check. Besides clearing the dirty flag, folio_clear_dirty_for_io() also calls folio_mkclean(), which write-protects the shared mmap PTEs mapping the folio. Note that we still do call folio_clear_dirty_for_io() later in submit_one_sector() when we clear dirty on the last sector of the folio (the only sector for non-subpage cases). But we lost this early call in extent_write_cache_pages().

Without the extra write-protection, a process with the file mmap-ed can modify a sector while it is being used by writeback in a way that expects a stable folio (checksumming, compressing, copying, etc...) without faulting, which manifests as a handful of concrete bugs.

  • 1.For large folios or subpage sectorsize, it is possible to submit a bio

which does not cover the whole folio. When this happens, we will have a bio in flight for a folio that we have *not* called folio_clear_dirty_for_io() on. If a task with an existing mmap-ed PTE writes (without faulting..) in this window, it can result in corruptions. If the write arrives while the checksumming or writing itself is underway, this can result in an invalid checksum and later corruption reports on read. If the write arrives after checksumming/writing is done but before the last sector dirty is cleared, then the write is present in page cache but doesn't affect the dirty tracking and will be lost when the folio is fully finished being submitted and the dirty bit is cleared. This results in losing the write even if fsync() is called.

  • 2.For zoned submissions which are done in batch separate from the main

extent_writepage() loop, we also risk csum violations for those submissions. Zoned writes are clamped to max_zone_append_size and are not aligned with folios, so a submission can span two folios. The first folio being processed in extent_write_cache_pages() will call extent_write_locked_range() which will submit the partial range of the next folio, while the rest of that folio could still be dirty. So clearing dirty on the submitted sectors doesn't call folio_clear_dirty_for_io() and we have the same issue. Since extent_write_cache_pages() skips these batch submitted folios (they are already marked for writeback from submission by the preceding folio), we must add the extra write protection in lock_delalloc_folios().

  • 3.For inline extents this will subtly risk losing writes that happen

after/while we copy the inline extent but before we clear dirty on the folio.

  • 4.For folios spanning EOF, mmap could tamper with the zeroed bytes past

EOF and cause them to be persisted where future faults would improperly see them instead of zeros.

  • 5.Finally, for compressed extents, we risk modifying the folios while we

work on compressing them which will result in corrupted compressed data. Specifically, in run_delalloc_compressed() we queue up work to do compress_file_range() in BTRFS_COMPRESSION_CHUNK_SIZE (512K) chunks which will call btrfs_folio_clamp_clear_dirty() on the range. For non-subpage, this will always clear the whole folio, safely. For subpage, we risk a partial clear here as well. In particular, imagine a 2M folio broken up into 512K chunks of work which might start compression work on one chunk before all the chunks compress_file_range() workers have gotten far enough to finish clearing all the dirty bitmaps of the folio and getting to folio_clear_dirty_for_io(). Large folios on the edges of submission ranges are similarly at risk to be only partly cleared. This particular gap was introduced by a second patch in the same series: commit a4ef54dbb576 ("btrfs: make extent_range_clear_dirty_for_io() to handle sector size < page size cases")

We cannot simply restore the call to folio_clear ---truncated---

Published 2026-09-11NVD

References 2
Review Av26.10.0x86_64Not affectedFable 5.2 · medium confidence · 2026-11-19

The regression this CVE describes is not in the 6.18.60 source we build: extent_write_cache_pages() still makes the early folio_clear_dirty_for_io() call that commit 095be159f3eb is said to have removed, so folios are write-protected before writeback.

The second change the CVE names (a4ef54dbb576, the compressed-write path) is in the source, but its gap only opens for subpage or large folios, or on zoned devices. None of those can occur in this build: CONFIG_BTRFS_EXPERIMENTAL and CONFIG_BLK_DEV_ZONED are off, and on x86_64 the btrfs block size is never smaller than the 4K page.

The upstream fix itself is not present and no applied patch touches btrfs, so this conclusion rests on reading the source, not on a backport. Btrfs is in active use by default (the persistent rw volume), so confirm the upstream affected range before closing; confidence is medium because I could not fetch the advisory or fix commits.

Evidence 11
  1. The early `folio_clear_dirty_for_io(folio)` call is still made before `extent_writepage()`, in addition to the `folio_test_dirty()` check at line 2617. The change the CVE attributes to 095be159f3eb (replacing this call with a plain dirty test) is not in this source.

    output/build/linux-6.18.60/fs/btrfs/extent_io.c:2649-2650 (extent_write_cache_pages)

  2. The comment says the PageDirty bit is cleared before entering this function and only the subpage dirty bit is cleared here, which matches the pre-regression design.

    output/build/linux-6.18.60/fs/btrfs/extent_io.c:1679-1685 (submit_one_sector)

  3. The a4ef54dbb576 change is present: the compression path uses `btrfs_folio_clamp_clear_dirty()`, which the CVE says is safe for non-subpage folios and risky only for subpage or large folios.

    output/build/linux-6.18.60/fs/btrfs/inode.c:829-847 (extent_range_clear_dirty_for_io)

  4. `btrfs_folio_clamp_clear_dirty()` calls `folio_clear_dirty_for_io()` on the whole folio whenever `btrfs_is_subpage()` is false, that is, whenever the sector size is not smaller than the folio size.

    output/build/linux-6.18.60/fs/btrfs/subpage.c:620-630 and subpage.h:107-113

  5. Large data folios are only enabled under `#ifdef CONFIG_BTRFS_EXPERIMENTAL`; without it data folios are single pages.

    output/build/linux-6.18.60/fs/btrfs/btrfs_inode.h:533-544 (btrfs_set_inode_mapping_order)

  6. `# CONFIG_BTRFS_EXPERIMENTAL is not set`, so there are no large data folios and the subpage and large-folio scenarios (items 1 and 5 of the CVE) cannot arise on 4K-page x86_64.

    output/build/linux-6.18.60/.config:4113

  7. `# CONFIG_BLK_DEV_ZONED is not set`, so the zoned batch-submission scenario (item 2) is not compiled in.

    output/build/linux-6.18.60/.config:873

  8. No extra write-protection is added here and `folio_mkclean` appears nowhere under `fs/btrfs`. The upstream fix is therefore not backported into this source.

    output/build/linux-6.18.60/fs/btrfs/extent_io.c:302-350 (lock_delalloc_folios)

  9. None of the 139 applied patches matches btrfs, `extent_io` or folio, so no local patch adds or removes the relevant code.

    output/build/linux-6.18.60/.applied_patches_list

  10. `CONFIG_BTRFS_FS=y`: btrfs is built into the kernel, so the package and subsystem are present.

    output/build/linux-6.18.60/.config:4108 and board/x86_64/linux_defconfig:332

  11. The DDI image (`IX_IMAGE_DDI=y` at output/.config:5284) creates and mounts a btrfs `rw` volume with subvolumes for `/cfg`, `/var`, `/root` and `/home`. Btrfs data writeback therefore runs by default, which matters if the not-affected conclusion turns out to be wrong.

    board/common/image/image-ddi/rootfs/usr/libexec/infix/mnt:109-122,206 and doc/boot.md:405-411

Version and patches

Tree is Linux 6.18.60 (output/build/linux-6.18.60/Makefile: VERSION 6, PATCHLEVEL 18, SUBLEVEL 60). NVD status is Received with no affected range, and the kernel CNA range and the two stable fix commits (074c715e0b49, 5376c9db4536) could not be fetched from this tree. By source inspection, the regressing change 095be159f3eb is absent (early folio_clear_dirty_for_io() still at fs/btrfs/extent_io.c:2650), a4ef54dbb576 is present (fs/btrfs/inode.c:829-847), and the fix is absent (no folio_mkclean in fs/btrfs, no change in lock_delalloc_folios()). No applied patch touches btrfs.

Recommendation

Document as not applicable to the x86_64 build of linux 6.18.60; no backport is needed now.

Re-check on each kernel bump: if a later 6.18.y or newer kernel drops the early folio_clear_dirty_for_io() call in extent_write_cache_pages() without also carrying the fix, the build becomes affected, and because the rw volume is btrfs it would be exposed by default.

Keep CONFIG_BTRFS_EXPERIMENTAL and CONFIG_BLK_DEV_ZONED disabled. Review the aarch64, arm and riscv64 kernel configs separately if they are shipped, since this review covered only the x86_64 config.

Open questions

The upstream affected range could not be confirmed offline. The CVE text says both introducing commits belong to the same series, yet this source contains one (a4ef54dbb576) and not the other (095be159f3eb). Someone should check the kernel CNA record or the two stable fix commits to confirm which branches they target and that 6.18.y is outside the affected range.

Only the x86_64 kernel config was reviewed. A board with pages larger than 4K (for example a 16K or 64K aarch64 kernel) could hit the subpage case through the a4ef54dbb576 path and would need its own assessment.

One combined shell command was refused by the sandbox; I re-ran the same read-only checks in a permitted form, so nothing is missing from the review.

Members of Kernel Kit decide. Sign in if you are one.