In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix exception exit lock checking for subprogs
processbpfexitfull() passes checklock = !curframe to checkresourceleak(), which is false in cases when bpfthrow() is called from a static subprog. This makes checkresourceleak() to skip validation of activerculocks, activepreemptlocks, and activeirq_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 checklock = true for exception exits regardless of curframe, since exceptions bypass all intermediate frame cleanup. Update the error message prefix to "bpfthrow" for exception exits to distinguish them from normal BPF_EXIT.
Fix rejectsubprogwithrcureadlock 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 bpfthrow. Update _msg annotations for affected tests to match the new "bpfthrow" error prefix.
The spinlock case is not affected because they are already checked [1] at the call site in docheckinsn() before bpfthrow 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
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31526.json"
}