CVE-2026-31526CWE-667

CVE-2026-31526

Medium · published April 22, 2026

CVSS v3.1
5.5
EPSS
0%
Percentile
2.6
In the wild
Unconfirmed
What it is

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

The record
Technical detail
CVSS v3.1
5.5 · MEDIUM
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS v4.0
Not supplied
EPSS
0.00133 · 2.6th percentile
Weakness
CWE-667 · Improper Locking
Published
2026-04-22T18:16Z
Affected products (6)
ProductVersionsFixed in
linux/linux_kernel≥ 6.7, < 6.18.216.18.21
linux/linux_kernel≥ 6.19, < 6.19.116.19.11
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
linux/linux_kernelall versions—
References (4)
EPSS history
Timeline
  • 22 APR 13:54Z
    bpf: Fix exception exit lock checking for subprogs
    cvelistv5