# CVE-2026-31526: bpf: Fix exception exit lock checking for subprogs

> 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.14% (percentile 2, 2026-11-28)
- **CWE:** CWE-667
- **Published:** 2026-04-22T13:54:39.800Z
- **Modified:** 2026-11-11T23:10:00.263Z

## Who should check

- Anyone running Linux \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 4eca06a55417c3b2e538656d12c89e224343653e; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< c0281da1f2aa5c2fca3a05f79b86bea96591c358; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 5a399f3117642494e35545f6ca397d3e177c1f9b; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 6c2128505f61b504c79a20b89596feba61388112
- Anyone running Linux 6.7

## Description

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

bpf: Fix exception exit lock checking for subprogs

process\_bpf\_exit\_full() passes check\_lock = !curframe to
check\_resource\_leak(), which is false in cases when bpf\_throw() is
called from a static subprog. This makes check\_resource\_leak() to skip
validation of active\_rcu\_locks, active\_preempt\_locks, and
active\_irq\_id on exception exits from subprogs.

At runtime bpf\_throw() unwinds the stack via ORC without releasing any
user-acquired locks, which may cause various issues as the result.

Fix by setting check\_lock = true for exception exits regardless of
curframe, since exceptions bypass all intermediate frame
cleanup. Update the error message prefix to "bpf\_throw" for exception
exits to distinguish them from normal BPF\_EXIT.

Fix reject\_subprog\_with\_rcu\_read\_lock test which was previously
passing for the wrong reason. Test program returned directly from the
subprog call without closing the RCU section, so the error was
triggered by the unclosed RCU lock on normal exit, not by
bpf\_throw. Update \_\_msg annotations for affected tests to match the
new "bpf\_throw" error prefix.

The spin\_lock case is not affected because they are already checked \[1\]
at the call site in do\_check\_insn() before bpf\_throw can run.

\[1\] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/bpf/verifier.c?h=v7.0-rc4\#n21098

## Affected and fixed versions

- Linux: \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 4eca06a55417c3b2e538656d12c89e224343653e; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< c0281da1f2aa5c2fca3a05f79b86bea96591c358; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 5a399f3117642494e35545f6ca397d3e177c1f9b; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 6c2128505f61b504c79a20b89596feba61388112 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2026-31526.md
Affected: Linux >= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, < 4eca06a55417c3b2e538656d12c89e224343653e; >= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, < c0281da1f2aa5c2fca3a05f79b86bea96591c358; >= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, < 5a399f3117642494e35545f6ca397d3e177c1f9b; >= f18b03fabaa9b7c80e80b72…
Fixed in: Linux 4eca06a55417c3b2e538656d12c89e224343653e, Linux 5a399f3117642494e35545f6ca397d3e177c1f9b, Linux 6c2128505f61b504c79a20b89596feba61388112

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

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

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

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

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

Linux \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 4eca06a55417c3b2e538656d12c89e224343653e; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< c0281da1f2aa5c2fca3a05f79b86bea96591c358; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 5a399f3117642494e35545f6ca397d3e177c1f9b; \>= f18b03fabaa9b7c80e80b72a621f481f0d706ae0, \< 6c2128505f61b504c79a20b89596feba61388112; Linux 6.7.

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

Yes. Fixed in Linux 4eca06a55417c3b2e538656d12c89e224343653e, Linux 5a399f3117642494e35545f6ca397d3e177c1f9b, Linux 6c2128505f61b504c79a20b89596feba61388112. Upgrade Linux to 6c2128505f61b504c79a20b89596feba61388112 or later.

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

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/c0281da1f2aa5c2fca3a05f79b86bea96591c358>
- patch: <https://git.kernel.org/stable/c/5a399f3117642494e35545f6ca397d3e177c1f9b>
- patch: <https://git.kernel.org/stable/c/6c2128505f61b504c79a20b89596feba61388112>
- other: <https://git.kernel.org/stable/c/4eca06a55417c3b2e538656d12c89e224343653e>

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

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