# CVE-2026-89772: btrfs: write-protect folios during data writeback

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.20% (percentile 5, 2026-11-26)
- **Published:** 2026-09-11T19:47:11.125Z
- **Modified:** 2026-10-19T09:18:20.490Z

## Who should check

- Anyone running Linux \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 074c715e0b498891c09fe7f11e1cd9d7a04699bd; \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 5376c9db45368eb210b4d71104ac00a59dc8b6e0
- Anyone running Linux 6.13

## 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---

## Affected and fixed versions

- Linux: \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 074c715e0b498891c09fe7f11e1cd9d7a04699bd; \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 5376c9db45368eb210b4d71104ac00a59dc8b6e0 (cvelist)
- Linux: 6.13 (cvelist)

## Mitigation

- Upgrade Linux to 5376c9db45368eb210b4d71104ac00a59dc8b6e0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-89772. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-89772.md
Affected: Linux >= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, < 074c715e0b498891c09fe7f11e1cd9d7a04699bd; >= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, < 5376c9db45368eb210b4d71104ac00a59dc8b6e0; Linux 6.13
Fixed in: Linux 074c715e0b498891c09fe7f11e1cd9d7a04699bd, Linux 5376c9db45368eb210b4d71104ac00a59dc8b6e0

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-89772 being exploited?

There is no confirmed exploitation: CVE-2026-89772 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-89772?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-89772?

Linux \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 074c715e0b498891c09fe7f11e1cd9d7a04699bd; \>= a4ef54dbb576032ba31a646a5ffc8a26a83cb92c, \< 5376c9db45368eb210b4d71104ac00a59dc8b6e0; Linux 6.13.

### Is there a fix for CVE-2026-89772?

Yes. Fixed in Linux 074c715e0b498891c09fe7f11e1cd9d7a04699bd, Linux 5376c9db45368eb210b4d71104ac00a59dc8b6e0. Upgrade Linux to 5376c9db45368eb210b4d71104ac00a59dc8b6e0 or later.

### How do I check if I'm affected by CVE-2026-89772?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/074c715e0b498891c09fe7f11e1cd9d7a04699bd>
- other: <https://git.kernel.org/stable/c/5376c9db45368eb210b4d71104ac00a59dc8b6e0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-89772>

HTML: <https://flawdb.com/CVE-2026-89772> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-89772>
