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

Status: published. Published: 2026-04-22. Updated: 2026-11-05.

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

## Remediation

No remediation reported in collected sources

## Affected products and versions

- Linux / Linux: ≥ f18b03fabaa9b7c80e80b72a621f481f0d706ae0; < 4eca06a55417c3b2e538656d12c89e224343653e (affected, git); ≥ f18b03fabaa9b7c80e80b72a621f481f0d706ae0; < c0281da1f2aa5c2fca3a05f79b86bea96591c358 (affected, git); ≥ f18b03fabaa9b7c80e80b72a621f481f0d706ae0; < 5a399f3117642494e35545f6ca397d3e177c1f9b (affected, git); ≥ f18b03fabaa9b7c80e80b72a621f481f0d706ae0; < 6c2128505f61b504c79a20b89596feba61388112 (affected, git). Source: CNA: Linux
- Linux / Linux: 6.7 (affected); ≥ 0; < 6.7 (unaffected, semver); ≥ 6.12.114; ≤ 6.12.* (unaffected, semver); ≥ 6.18.21; ≤ 6.18.* (unaffected, semver); ≥ 6.19.11; ≤ 6.19.* (unaffected, semver); ≥ 7.0; ≤ * (unaffected, original_commit_for_fix). Source: CNA: Linux

## Severity and prioritization

- CISA KEV: No listing in collected sources

- EPSS: 0.13% as of 2026-11-05; percentile 2.41%

- SSVC: exploitation none; automatable no; technical impact partial; source ADP: CISA-ADP

- Weaknesses: Not reported

## Exploit evidence

No exploit evidence in collected sources. This is not proof of no exploitation.

## References

- https://git.kernel.org/stable/c/4eca06a55417c3b2e538656d12c89e224343653e (CNA: Linux)

- https://git.kernel.org/stable/c/c0281da1f2aa5c2fca3a05f79b86bea96591c358 (CNA: Linux)

- https://git.kernel.org/stable/c/5a399f3117642494e35545f6ca397d3e177c1f9b (CNA: Linux)

- https://git.kernel.org/stable/c/6c2128505f61b504c79a20b89596feba61388112 (CNA: Linux)

## Provenance

- CNA: Linux: https://www.cve.org/CVERecord?id=CVE-2026-31526; retrieved 2026-11-05; source updated 2026-11-05

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-31526; retrieved 2026-11-05; source updated Not reported

Revision: ab3b712974b6a3d93230014e5eba11a8c728f1bfed2c27d4357de93ef44a616c

Canonical: https://y2.dev/cve/CVE-2026-31526

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.