CVE-2026-139321

bpf: Forbid sleeping in bpf_find_vma() callbacks

Published Nov 30, 2026 CVSS 3.1 · 4.4 Medium EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Forbid sleeping in bpf_find_vma() callbacks

A sleepable program can call bpf_find_vma() and use a sleepable helper
such as bpf_copy_from_user() or bpf_copy_from_user_task() in the
callback. The verifier accepts this, but bpf_find_vma() runs the callback
with the mmap_lock of the mm held for read. If the user copy faults on
that mm, the fault handler has to take mmap_lock again. Lockdep reports
recursive locking, and if a writer queued up in between, the fault blocks
behind the writer, which waits for the read lock the helper already
holds:

sleepable prog other thread of the same mm
bpf_find_vma(current, ...)
mmap_read_trylock(mm)
mmap_write_lock(mm) <- waits
callback: copy_from_user()
page fault
mmap_read_lock(mm) <- queued behind the writer

This is the same problem as with sleepable task_vma iterator programs.
The verifier checks synchronous callbacks in the caller's context, so
in_sleepable_context() is true in the callback of a sleepable program.

Verify the callback like a hash map for_each callback, as running in an
RCU read-side critical section where sleeping is not allowed, and actually
hold rcu_read_lock() around it, so that global functions the callback
calls, which are then verified for a non-sleepable context, see the RCU
protection they are verified with.

Non-sleepable programs already run the callback under RCU, nothing changes
for them. A sleepable program whose bpf_find_vma() callback calls any
helper, kfunc or global function that may sleep is now rejected by the
verifier, including ones that would be harmless under mmap_lock as they
don't touch user memory.

Analysis

AI-generated

Technical impact

BPF programs that are allowed to sleep may call helpers such as bpf_copy_from_user() inside a bpf_find_vma() callback. The verifier incorrectly accepts this, while the kernel holds a read lock on mmap_lock during the callback. If the helper triggers a page fault, the fault handler attempts to reacquire mmap_lock, leading to recursive locking. When another thread requests a write lock, the faulting callback is blocked behind the writer, resulting in a deadlock that can freeze threads and degrade system responsiveness – a denial‑of service at kernel level.

Affected Systems

All Linux kernel releases that lack the commit which forbids sleeping in bpf_find_vma() callbacks are affected. The vulnerability is confined to the BPF subsystem of the Linux kernel. Any system that allows user‑land programs to load sleepable BPF programs that invoke helpers that may sleep is potentially vulnerable.

Risk and Exploitability

The Likeliness of exploitation depends on an attacker’s ability to supply a sleepable BPF program that uses a sleeping helper. The EPSS score is unavailable and the vulnerability is not listed in CISA KEV, yet the kernel-level deadlock can cause significant service degradation. The risk is moderate to high in environments that enable complex BPF features, particularly when untrusted code can be loaded. No public exploit is currently known, but this does not mitigate the severity sentence.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the commit forbidding sleeping in bpf_find_vma() callbacks.
  • Refactor user‑land BPF programs that perform bpf_find_vma() callbacks so they do not invoke helpers that may sleep, such as bpf_copy_from_user or bpf_copy_from_user_task.
  • If a kernel update is not immediately possible, restrict or disable the execution of such BPF programs through policy or cgroup isolation to protect against potential deadlocks.

Generated by OpenCVE AI on December 1, 2026 at 07:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-833
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate

Type Values Removed Values Added
Weaknesses CWE-673
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Forbid sleeping in bpf_find_vma() callbacks A sleepable program can call bpf_find_vma() and use a sleepable helper such as bpf_copy_from_user() or bpf_copy_from_user_task() in the callback. The verifier accepts this, but bpf_find_vma() runs the callback with the mmap_lock of the mm held for read. If the user copy faults on that mm, the fault handler has to take mmap_lock again. Lockdep reports recursive locking, and if a writer queued up in between, the fault blocks behind the writer, which waits for the read lock the helper already holds: sleepable prog other thread of the same mm bpf_find_vma(current, ...) mmap_read_trylock(mm) mmap_write_lock(mm) <- waits callback: copy_from_user() page fault mmap_read_lock(mm) <- queued behind the writer This is the same problem as with sleepable task_vma iterator programs. The verifier checks synchronous callbacks in the caller's context, so in_sleepable_context() is true in the callback of a sleepable program. Verify the callback like a hash map for_each callback, as running in an RCU read-side critical section where sleeping is not allowed, and actually hold rcu_read_lock() around it, so that global functions the callback calls, which are then verified for a non-sleepable context, see the RCU protection they are verified with. Non-sleepable programs already run the callback under RCU, nothing changes for them. A sleepable program whose bpf_find_vma() callback calls any helper, kfunc or global function that may sleep is now rejected by the verifier, including ones that would be harmless under mmap_lock as they don't touch user memory.
Title bpf: Forbid sleeping in bpf_find_vma() callbacks
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM
Severity
Moderate
Public date
Nov 30, 2026, 1:33 PM