# CVE-2026-23157: btrfs: do not strictly require dirty metadata threshold for metadata writepages

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.15% (percentile 2, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2026-02-14T16:01:23.874Z
- **Modified:** 2026-11-05T22:18:04.890Z

## Who should check

- Anyone running Linux \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< bb9be3f713652e330df00f3724c18c7a5469e7ac; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 0c3666ec188640c20e254011e7adf4464c32ee58; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 629666d20c7dcd740e193ec0631fdff035b1f7d6; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4e159150a9a56d66d247f4b5510bed46fe58aa1c
- Anyone running Linux 2.6.29

## Description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: do not strictly require dirty metadata threshold for metadata writepages

\[BUG\]
There is an internal report that over 1000 processes are
waiting at the io\_schedule\_timeout() of balance\_dirty\_pages(), causing
a system hang and trigger a kernel coredump.

The kernel is v6.4 kernel based, but the root problem still applies to
any upstream kernel before v6.18.

\[CAUSE\]
From Jan Kara for his wisdom on the dirty page balance behavior first.

  This cgroup dirty limit was what was actually playing the role here
  because the cgroup had only a small amount of memory and so the dirty
  limit for it was something like 16MB.

  Dirty throttling is responsible for enforcing that nobody can dirty
  (significantly) more dirty memory than there's dirty limit. Thus when
  a task is dirtying pages it periodically enters into balance\_dirty\_pages()
  and we let it sleep there to slow down the dirtying.

  When the system is over dirty limit already (either globally or within
  a cgroup of the running task), we will not let the task exit from
  balance\_dirty\_pages() until the number of dirty pages drops below the
  limit.

  So in this particular case, as I already mentioned, there was a cgroup
  with relatively small amount of memory and as a result with dirty limit
  set at 16MB. A task from that cgroup has dirtied about 28MB worth of
  pages in btrfs btree inode and these were practically the only dirty
  pages in that cgroup.

So that means the only way to reduce the dirty pages of that cgroup is
to writeback the dirty pages of btrfs btree inode, and only after that
those processes can exit balance\_dirty\_pages().

Now back to the btrfs part, btree\_writepages() is responsible for
writing back dirty btree inode pages.

The problem here is, there is a btrfs internal threshold that if the
btree inode's dirty bytes are below the 32M threshold, it will not
do any writeback.

This behavior is to batch as much metadata as possible so we won't write
back those tree blocks and then later re-COW them again for another
modification.

This internal 32MiB is higher than the existing dirty page size (28MiB),
meaning no writeback will happen, causing a deadlock between btrfs and
cgroup:

- Btrfs doesn't want to write back btree inode until more dirty pages

- Cgroup/MM doesn't want more dirty pages for btrfs btree inode
  Thus any process touching that btree inode is put into sleep until
  the number of dirty pages is reduced.

Thanks Jan Kara a lot for the analysis of the root cause.

\[ENHANCEMENT\]
Since kernel commit b55102826d7d ("btrfs: set AS\_KERNEL\_FILE on the
btree\_inode"), btrfs btree inode pages will only be charged to the root
cgroup which should have a much larger limit than btrfs' 32MiB
threshold.
So it should not affect newer kernels.

But for all current LTS kernels, they are all affected by this problem,
and backporting the whole AS\_KERNEL\_FILE may not be a good idea.

Even for newer kernels I still think it's a good idea to get
rid of the internal threshold at btree\_writepages(), since for most cases
cgroup/MM has a better view of full system memory usage than btrfs' fixed
threshold.

For internal callers using btrfs\_btree\_balance\_dirty() since that
function is already doing internal threshold check, we don't need to
bother them.

But for external callers of btree\_writepages(), just respect their
requests and write back whatever they want, ignoring the internal
btrfs threshold to avoid such deadlock on btree inode dirty page
balancing.

## Affected and fixed versions

- Linux: \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< bb9be3f713652e330df00f3724c18c7a5469e7ac; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 0c3666ec188640c20e254011e7adf4464c32ee58; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 629666d20c7dcd740e193ec0631fdff035b1f7d6; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4e159150a9a56d66d247f4b5510bed46fe58aa1c (cvelist)
- Linux: 2.6.29 (cvelist)

## Mitigation

- Upgrade Linux to 4e159150a9a56d66d247f4b5510bed46fe58aa1c 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-23157. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-23157.md
Affected: Linux >= 793955bca66c99defdffc857ae6eb7e8431d6bbe, < 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90; >= 793955bca66c99defdffc857ae6eb7e8431d6bbe, < bb9be3f713652e330df00f3724c18c7a5469e7ac; >= 793955bca66c99defdffc857ae6eb7e8431d6bbe, < 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a; >= 793955bca66c99defdffc85…
Fixed in: Linux 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90, Linux 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a, Linux 0c3666ec188640c20e254011e7adf4464c32ee58, Linux 629666d20c7dcd740e193ec0631fdff035b1f7d6, Linux 4e159150a9a56d66d247f4b5510bed46fe58aa1c

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-23157 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< bb9be3f713652e330df00f3724c18c7a5469e7ac; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 0c3666ec188640c20e254011e7adf4464c32ee58; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 629666d20c7dcd740e193ec0631fdff035b1f7d6; \>= 793955bca66c99defdffc857ae6eb7e8431d6bbe, \< 4e159150a9a56d66d247f4b5510bed46fe58aa1c; Linux 2.6.29.

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

Yes. Fixed in Linux 6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90, Linux 4357e02cafabe01c2d737ceb4c4c6382fc2ee10a, Linux 0c3666ec188640c20e254011e7adf4464c32ee58, Linux 629666d20c7dcd740e193ec0631fdff035b1f7d6, Linux 4e159150a9a56d66d247f4b5510bed46fe58aa1c. Upgrade Linux to 4e159150a9a56d66d247f4b5510bed46fe58aa1c or later.

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

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

- patch: <https://git.kernel.org/stable/c/629666d20c7dcd740e193ec0631fdff035b1f7d6>
- patch: <https://git.kernel.org/stable/c/4e159150a9a56d66d247f4b5510bed46fe58aa1c>
- other: <https://git.kernel.org/stable/c/6a8b6242eaa1dd7a0de2d6de6420d10ffe68db90>
- other: <https://git.kernel.org/stable/c/bb9be3f713652e330df00f3724c18c7a5469e7ac>
- other: <https://git.kernel.org/stable/c/4357e02cafabe01c2d737ceb4c4c6382fc2ee10a>
- other: <https://git.kernel.org/stable/c/0c3666ec188640c20e254011e7adf4464c32ee58>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-784472.html>

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

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