# CVE-2026-139677: kernfs: don't hold kernfs\_rwsem across dir\_emit()

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-11-30T13:36:57.653Z
- **Modified:** 2026-11-30T14:19:55.577Z

> **AI summary (AI-generated, claude-haiku-5-5):** In the Linux kernel's kernfs, holding a lock across directory entry emission to userspace can stall sysfs and cgroupfs operations under memory pressure; the fix releases the lock around dir\_emit().

## Who should check

- Anyone running Linux \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< a8c18ee33f5892e753e74001dcfb802a2f280831; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 18972293f131ef82eaf45f44c5599c3998292dfd; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 341c65579de5b632eb7913bb68b3e375eeeb3ddf
- Anyone running Linux 6.15

## Description

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

kernfs: don't hold kernfs\_rwsem across dir\_emit()

kernfs\_fop\_readdir() holds kernfs\_rwsem for reading across the whole
listing, dir\_emit() included.  dir\_emit() copies to userspace, so it can
fault into reclaim while holding the lock that every create, remove and
rename in the hierarchy needs.  sysfs and cgroupfs have one per machine.

Under memory pressure the monitoring daemons fault on their own
getdents(2) buffer with it held:

        below: page allocation stall for 120 secs: order:0,
        mode:0x140dca(GFP\_HIGHUSER\_MOVABLE\|\_\_GFP\_ZERO\|\_\_GFP\_COMP)
        nodemask=(null),cpuset=hostcritical.slice,mems\_allowed=0
        Call Trace:
         \<TASK\>
         dump\_stack\_lvl+0x5d/0x80
         \_\_alloc\_frozen\_pages\_noprof+0x5f4d/0x6300
         ? memcg\_list\_lru\_alloc+0x73/0x320
         ? ima\_file\_check+0xd0/0x7d0
         vma\_alloc\_folio\_noprof+0x145/0x560
         handle\_mm\_fault+0x17c9/0x2720
         ? find\_vma+0x27/0x30
         do\_user\_addr\_fault+0x39f/0x6e0
         exc\_page\_fault+0x8f/0x110
         asm\_exc\_page\_fault+0x22/0x30
        RIP: 0010:filldir64+0xd7/0x1a0
        \[Code:/RSP:/RAX:..R15: register block elided\]
         kernfs\_fop\_readdir+0x2de/0x420
         iterate\_dir+0x8c/0x1f0
         \_\_se\_sys\_getdents64+0x61/0xe0
         ? copy\_page\_from\_iter+0x860/0x860
         do\_syscall\_64+0x6a/0x250
         entry\_SYSCALL\_64\_after\_hwframe+0x4b/0x53
         \</TASK\>

Commit 9aab10a0249e ("kernfs: Don't re-lock kernfs\_root::kernfs\_rwsem in
kernfs\_fop\_readdir().") took the lock drop out because dir\_emit() was
handed kernfs\_node::name, which a rename can free.  The previous patch
emits a copy instead, so drop the lock around dir\_emit().

A listing is no longer atomic within one getdents(2) call, which for
most sysfs and cgroup directories is all of it.  POSIX leaves that
unspecified for an entry added or removed since opendir(3).

## Affected and fixed versions

- Linux: \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< a8c18ee33f5892e753e74001dcfb802a2f280831; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 18972293f131ef82eaf45f44c5599c3998292dfd; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 341c65579de5b632eb7913bb68b3e375eeeb3ddf (cvelist)
- Linux: 6.15 (cvelist)

## Technologies

Linux kernel

## Mitigation

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

Details: https://flawdb.com/CVE-2026-139677.md
Affected: Linux >= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, < a8c18ee33f5892e753e74001dcfb802a2f280831; >= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, < 18972293f131ef82eaf45f44c5599c3998292dfd; >= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, < 341c65579de5b632eb7913bb68b3e375eeeb3ddf; Linux 6.15
Fixed in: Linux 18972293f131ef82eaf45f44c5599c3998292dfd, Linux 341c65579de5b632eb7913bb68b3e375eeeb3ddf

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

There is no confirmed exploitation: CVE-2026-139677 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

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

It has no CVSS score yet. Unknown.

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

Linux \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< a8c18ee33f5892e753e74001dcfb802a2f280831; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 18972293f131ef82eaf45f44c5599c3998292dfd; \>= 9aab10a0249eab4ec77c6a5e4f66442610c12a09, \< 341c65579de5b632eb7913bb68b3e375eeeb3ddf; Linux 6.15.

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

Yes. Fixed in Linux 18972293f131ef82eaf45f44c5599c3998292dfd, Linux 341c65579de5b632eb7913bb68b3e375eeeb3ddf. Upgrade Linux to 341c65579de5b632eb7913bb68b3e375eeeb3ddf or later.

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

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/a8c18ee33f5892e753e74001dcfb802a2f280831>
- other: <https://git.kernel.org/stable/c/18972293f131ef82eaf45f44c5599c3998292dfd>
- other: <https://git.kernel.org/stable/c/341c65579de5b632eb7913bb68b3e375eeeb3ddf>

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

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