CVE-2026-31526
Resource Leak Vulnerability in Linux Kernel BPF Subprogram Exception Handling
Publication date: 2026-04-22
Last updated on: 2026-04-28
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | 7.0 |
| linux | linux_kernel | 7.0 |
| linux | linux_kernel | 7.0 |
| linux | linux_kernel | 7.0 |
| linux | linux_kernel | From 6.19 (inc) to 6.19.11 (exc) |
| linux | linux_kernel | From 6.7 (inc) to 6.18.21 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-667 | The product does not properly acquire or release a lock on a resource, leading to unexpected resource state changes and behaviors. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Linux kernel's BPF (Berkeley Packet Filter) subsystem. Specifically, it involves improper lock checking during exception exits from BPF subprograms (subprogs). When an exception occurs and bpf_throw() is called from a static subprog, the system skips validation of certain locks (active_rcu_locks, active_preempt_locks, and active_irq_id). This happens because the check_resource_leak() function receives an incorrect flag, causing it to bypass necessary lock checks. As a result, user-acquired locks may remain unreleased during stack unwinding, potentially leading to various issues.
The fix involves always setting the lock check flag to true during exception exits, ensuring that all locks are properly validated and released. Additionally, error messages were updated to distinguish exception exits from normal exits.
How can this vulnerability impact me? :
This vulnerability can cause user-acquired locks to remain unreleased when exceptions occur in BPF subprograms. Unreleased locks can lead to system instability, including potential deadlocks, resource leaks, or other unpredictable behavior in the kernel. This may degrade system performance or cause failures in applications relying on BPF programs.
What immediate steps should I take to mitigate this vulnerability?
The vulnerability has been resolved in the Linux kernel by fixing the exception exit lock checking for subprograms in the BPF verifier. To mitigate this vulnerability, you should update your Linux kernel to a version that includes this fix.
- Apply the kernel patch that sets check_lock = true for exception exits regardless of curframe.
- Update your system to the latest stable Linux kernel release that contains this fix.
- Avoid running untrusted BPF programs until the fix is applied.