HIGH Introduced in 5.17
bpf FindVma UAF
CVE-2026-93137
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.5HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix use-after-free on mm_struct in bpf_find_vma() bpf_find_vma() reads task->mm and calls mmap_read_trylock(mm) without holding a reference on the mm. On a foreign task, a concurrent exit_mm() can free the mm_struct between the lockless read and the trylock, resulting in a use-after-free. mm_struct is not SLAB_TYPESAFE_BY_RCU. For the current task, task->mm is stable. For a foreign task, pin the mm under task->alloc_lock and release it with mmput_async(), mirroring commit d8e27d2d22b6 ("bpf: fix mm lifecycle in open-coded task_vma iterator"). Use spin_trylock() instead of get_task_mm() so BPF context does not block on alloc_lock. Reject irqs-disabled contexts and !CONFIG_MMU on the foreign-task path because dropping the mm reference is not safe there. Race: CPU0 (BPF program) CPU1 (exiting task) ============================ ========================== bpf_find_vma(foreign_task): mm = task->mm exit_mm(): task->mm = NULL mmput(mm) -> frees mm_struct mmap_read_trylock(mm) // UAF on mm
02KernelScan AI Analysis
Risk summary
A BPF program using the bpf_find_vma() helper on a foreign task can trigger a use-after-free on the mm_struct if that task exits concurrently. This requires the ability to load BPF tracing programs (CAP_BPF) and winning a narrow race window, but successful exploitation could yield arbitrary kernel memory read/write. Systems running untrusted or tenant-supplied BPF programs are most at risk.
Vulnerability analysis
A helper used to look up another process's memory region reads that process's memory map pointer without holding a reference, then tries to lock the map for the lookup. If the target process exits concurrently, its memory map can be freed in the narrow window between the pointer read and the lock attempt, resulting in a use-after-free on kernel heap memory. The fix leaves lookups on the current process unchanged, but for other processes it pins the map with a short non-blocking lock and releases the reference afterward via an asynchronous cleanup mechanism. This foreign-process path is also refused in restricted contexts where safely releasing such a reference is not possible. The flaw is reachable by anyone who can load BPF tracing programs, which requires an elevated privilege typically granted to administrators or available within user namespaces.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.17 | 6.1.188 | db347840d6b6 |
| 6.12 | 5.17 | 6.12.110 | c7ad910e9870 |
| mainline | 5.17 | 7.3-rc1 | 47b079e2117a |
| 7.2 | 5.17 | 7.2.6 | 2b2a903bee56 |
| 6.18 | 5.17 | 6.18.52 | 86d54cf069fc |
| 6.6 | 5.17 | 6.6.157 | 8e1101fc4118 |
| cip/6.12 | 5.17 | 6.12.111-cip32 | c7ad910e9870 |