CVE-2026-139322

Not scored yetLast modified Nov 30, 2026

Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Reject sleepable programs for task_vma iterator

A sleepable "iter.s/task_vma" program can be attached, but its ->show() callback runs with the mmap_lock of the iterated mm held for read. As soon as the program runs, bpf_iter_run_prog() calls might_fault(), and any bpf_copy_from_user() or bpf_copy_from_user_task() it does may really fault or take mmap_lock again. With lockdep this is reported as recursive locking of mmap_lock. Without lockdep, a fault on the reader's own mm, or access_process_vm() on the iterated mm, has to take mmap_lock for read again. If a writer queued up in the meantime that blocks behind the writer, which in turn waits for the read lock the iterator already holds, and the read() hangs:

reader (iter.s/task_vma) other thread of the same mm task_vma_seq_get_next() mmap_read_lock(mm) mmap_write_lock(mm) <- waits bpf prog: copy_from_user() page fault mmap_read_lock(mm) <- queued behind the writer

The reader waits killable, so the hang lasts until it gets a fatal signal.

bpf_iter_link_attach() allows sleepable programs for the targets that set BPF_ITER_RESCHED, and task_vma sets it because cond_resched() between VMAs is fine with mmap_lock held. Rescheduling between objects and running a sleepable program inside ->show() are different properties, though, and task_vma only has the first one. The open-coded task_vma iterator does not have this problem since it hands out a snapshot of the VMA and holds no lock when it returns to the program.

The vma handed to the program is only stable under mmap_lock, so the lock can't be dropped around ->show(). Add a feature flag BPF_ITER_NOSLEEP for targets which can't run sleepable programs although they can reschedule, and set it for task_vma.

The check at attach time is not enough. BPF_LINK_UPDATE replaces the program of a link, and bpf_iter_link_replace() only compares the type, the attach type and the BTF id of the two programs, which are the same for a sleepable and a non-sleepable one. Do the check there as well. That also closes this way around the existing rule: so far a sleepable program could be put on a link of a target that doesn't set BPF_ITER_RESCHED, like the hash map element iterator, which runs it under rcu_read_lock().

BPF_LINK_CREATE of a sleepable program for the task_vma target, and BPF_LINK_UPDATE to one, now fail with -EINVAL, also for programs that don't touch user memory and have been working since sleepable iterator programs exist. The programs can still be loaded. They have to be loaded as non-sleepable programs, or use the open-coded iterator.

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

VendorProductVersions
LinuxLinux>= b77fb25dcb342788d72ad7533163c34b8b823a1d, < e85ae2a3a50f5f358490ba347fec6a3dc2cc63b0; >= b77fb25dcb342788d72ad7533163c34b8b823a1d, < 40b788f482d3d9c959210548848228b8bd571aa4; >= b77fb25dcb342788d72ad7533163c34b8b823a1d, < a6bf637ff9d78d20aa4955cfd58c72369dc8f9bd; >= b77fb25dcb342788d72ad7533163c34b8b823a1d, < dfcd1765911223df60845e288ad392d5237f47a3
LinuxLinux5.18

References

Timeline

Published
Nov 30, 2026
Last modified
Nov 30, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-139323In the Linux kernel, the following vulnerability has been resolved: bpf: Don't hand out a linked element as extra element When htab_map_upCVE-2026-139324In the Linux kernel, the following vulnerability has been resolved: bpf: Don't leak the inode when token creation fails bpf_token_create()CVE-2026-139325In the Linux kernel, the following vulnerability has been resolved: bpf: Forbid sleeping in hash map for_each callbacks A sleepable prograCVE-2026-1393268.1In the Linux kernel, the following vulnerability has been resolved: bpf: Use the frame mem type in devmap egress XDP A devmap egress progrCVE-2026-139327In the Linux kernel, the following vulnerability has been resolved: bpf: Fix verifier WARN on narrow read of bpf_tcp_sock u64 fields A BPFCVE-2026-139328In the Linux kernel, the following vulnerability has been resolved: sched_ext: Fix a bypassed task stalling on a cpu its scheduler has no cCVE-2026-139329In the Linux kernel, the following vulnerability has been resolved: ALSA: jack: Protect the index scan against control removal A control fCVE-2026-139335.3Insufficient policy enforcement in Passwords in Google Chrome prior to 150.0.7871.47 allowed a remote attacker who had compromised the rendeCVE-2026-139330In the Linux kernel, the following vulnerability has been resolved: dpll: zl3073x: do not offer 0 Hz as a supported pin frequency zl3073x_CVE-2026-139331In the Linux kernel, the following vulnerability has been resolved: bpf, x86: Pass a trampoline's stack arguments by the calling conventionCVE-2026-139332In the Linux kernel, the following vulnerability has been resolved: bpf: Claim the per-CPU send_signal irq_work before filling it irq_workCVE-2026-139333In the Linux kernel, the following vulnerability has been resolved: btrfs: update the inode item when removing a free space inode btrfs_re
CVE-2026-139322: Unscored | Vulnix