In the Linux kernel, the following vulnerability has been resolved: btrfs: write-protect folios during data writeback commit 095be159f3eb ("btrfs:… (CVE-2026-89772)
In the Linux kernel, the following vulnerability has been resolved: 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---
AI Analysis
Technical Summary
The Linux kernel Btrfs filesystem had a vulnerability caused by replacing a call to folio_clear_dirty_for_io() with a simpler folio_test_dirty() check in extent_write_cache_pages(). folio_clear_dirty_for_io() not only clears the dirty flag but also write-protects shared mmap page table entries (PTEs) mapping the folio. Without this write-protection, processes could modify sectors during writeback without faults, causing data corruption, invalid checksums, lost writes, and corrupted compressed data. This affects large folios, zoned writes, inline extents, folios spanning EOF, and compressed extents. The vulnerability was introduced by a patch that handled sector sizes smaller than page sizes but inadvertently removed the necessary write-protection call. The fix involves restoring the write-protection in appropriate code paths to ensure stable folios during writeback.
Potential Impact
The vulnerability can lead to data corruption, invalid checksums, lost writes even after fsync(), and corrupted compressed data in Btrfs filesystems. Processes with mmap-ed files could modify data during writeback without triggering faults, undermining data integrity. This affects large folios, zoned block device submissions, inline extents, and compressed extents, potentially causing persistent filesystem corruption and data loss.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to restore the missing write-protection call (folio_clear_dirty_for_io()) during data writeback in Btrfs. Users should update to the fixed kernel version containing commit 095be159f3eb and related patches. No additional mitigation is required once the kernel is updated.
In the Linux kernel, the following vulnerability has been resolved: btrfs: write-protect folios during data writeback commit 095be159f3eb ("btrfs:… (CVE-2026-89772)
Description
In the Linux kernel, the following vulnerability has been resolved: 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---
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Linux kernel Btrfs filesystem had a vulnerability caused by replacing a call to folio_clear_dirty_for_io() with a simpler folio_test_dirty() check in extent_write_cache_pages(). folio_clear_dirty_for_io() not only clears the dirty flag but also write-protects shared mmap page table entries (PTEs) mapping the folio. Without this write-protection, processes could modify sectors during writeback without faults, causing data corruption, invalid checksums, lost writes, and corrupted compressed data. This affects large folios, zoned writes, inline extents, folios spanning EOF, and compressed extents. The vulnerability was introduced by a patch that handled sector sizes smaller than page sizes but inadvertently removed the necessary write-protection call. The fix involves restoring the write-protection in appropriate code paths to ensure stable folios during writeback.
Potential Impact
The vulnerability can lead to data corruption, invalid checksums, lost writes even after fsync(), and corrupted compressed data in Btrfs filesystems. Processes with mmap-ed files could modify data during writeback without triggering faults, undermining data integrity. This affects large folios, zoned block device submissions, inline extents, and compressed extents, potentially causing persistent filesystem corruption and data loss.
Mitigation Recommendations
A fix has been implemented in the Linux kernel to restore the missing write-protection call (folio_clear_dirty_for_io()) during data writeback in Btrfs. Users should update to the fixed kernel version containing commit 095be159f3eb and related patches. No additional mitigation is required once the kernel is updated.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xrh7-4f5f-76f9
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-89772"]
Threat ID: 6aa49ff555bf5e2cf5a8659d
Added to database: 09/12/2026, 00:42:29 UTC
Last enriched: 09/12/2026, 00:46:21 UTC
Last updated: 09/12/2026, 00:47:06 UTC
Views: 1
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.