CVE-2026-139304

bpf: Check the maps that sleepable callbacks use

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: Check the maps that sleepable callbacks use

Sleepable programs can only use the kinds of map that do without an RCU
read side critical section. check_map_prog_compatibility() sees to that
when a map is bound to the program, and asks whether the program is
sleepable. That misses the bpf_wq or bpf_task_work callback of a program
that is not, which runs sleepable all the same, and it misses an inner
map, which is not bound.

The bpf_wq callback of a tc program that looks a key up in a sockhash
gets as far as

WARNING: net/core/sock_map.c:903 at __sock_hash_lookup_elem+0x18f/0x1e0

Ask the same question for the map that is handed to a helper in sleepable
context, unless the RCU read lock is held: by bpf_rcu_read_lock(), or by
the helper that runs the callback, as bpf_for_each_map_elem() does for a
hash map. Programs that take the lock go on working. Disabled preemption
or interrupts are not enough, since the maps ask for rcu_read_lock_held().
The other parts of the program may use such a map as before.

A global function that is called with preemption or interrupts disabled is
verified for the non-sleepable context, in which nothing is known of all
that. Verify it for a context of its own: not sleepable, and without the
RCU read lock. It differs in what maps can be used, and in nothing else.

What is refused from now on runs into the warning above, or uses what the
map frees behind a plain RCU grace period: an entry of a devmap, of a perf
event array or of a cgroup array.

A bloom filter does without RCU. Add it to the list, so that callbacks
which use one go on loading. As a side effect sleepable programs can use
bloom filters as well.

A pointer to the value of a devmap which a program keeps beyond
bpf_rcu_read_unlock() is not dealt with here.

Analysis

AI-generated

Technical impact

The Linux kernel BPF subsystem contains a defect where the routine that checks map compatibility for sleepable callbacks bypasses certain callback types, such as bpf_wq or bpf_task_work, and inner map accesses. This omission allows a sleepable BPF program to operate on maps that normally require an RCU read lock, leading to use‑after‑free or race conditions that can corrupt kernel memory and trigger a crash.

Affected Systems

All Linux kernel builds that have not yet incorporated the patch commits referenced in the provided commit links are impacted. The issue is present in any distribution that uses the standard Linux kernel without the code changes in those commits.

Risk and Exploitability

No CVSS or KEV score is published, but the flaw can be leveraged by an attacker who can load a kernel‑level BPF program. The missing lock checks directly lead to kernel panic or memory corruption, providing a potential vector for privilege escalation. The exploitation path involves crafting a sleepable BPF program that accesses a protected map without acquiring the required RCU lock, which the kernel will then mishandle.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version that contains the patch commits (e.g., apply the changes from 3e6d7522af2cd1b8bf135ee7df6ca962986f44d6 or 9f13a653c21d5efb99c44b7adc3fa9005b20c442).
  • If an immediate kernel upgrade is not possible, configure the kernel to reject unsupported map types or disable sleepable BPF hooks such as bpf_wq and bpf_task_work in the kernel configuration.
  • Restrict deployment of BPF programs to only the map types permitted by the updated kernel (e.g., bloom filters) and avoid referencing RCU‑protected maps from sleepable callbacks.
  • Monitor kernel logs for warnings such as "WARNING: net/core/sock_map.c" to detect misuse of disallowed maps and terminate the offending BPF programs promptly.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-825
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-362
CWE-416
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Check the maps that sleepable callbacks use Sleepable programs can only use the kinds of map that do without an RCU read side critical section. check_map_prog_compatibility() sees to that when a map is bound to the program, and asks whether the program is sleepable. That misses the bpf_wq or bpf_task_work callback of a program that is not, which runs sleepable all the same, and it misses an inner map, which is not bound. The bpf_wq callback of a tc program that looks a key up in a sockhash gets as far as WARNING: net/core/sock_map.c:903 at __sock_hash_lookup_elem+0x18f/0x1e0 Ask the same question for the map that is handed to a helper in sleepable context, unless the RCU read lock is held: by bpf_rcu_read_lock(), or by the helper that runs the callback, as bpf_for_each_map_elem() does for a hash map. Programs that take the lock go on working. Disabled preemption or interrupts are not enough, since the maps ask for rcu_read_lock_held(). The other parts of the program may use such a map as before. A global function that is called with preemption or interrupts disabled is verified for the non-sleepable context, in which nothing is known of all that. Verify it for a context of its own: not sleepable, and without the RCU read lock. It differs in what maps can be used, and in nothing else. What is refused from now on runs into the warning above, or uses what the map frees behind a plain RCU grace period: an entry of a devmap, of a perf event array or of a cgroup array. A bloom filter does without RCU. Add it to the list, so that callbacks which use one go on loading. As a side effect sleepable programs can use bloom filters as well. A pointer to the value of a devmap which a program keeps beyond bpf_rcu_read_unlock() is not dealt with here.
Title bpf: Check the maps that sleepable callbacks use
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-416

    Use After Free

  • CWE-825

    Expired Pointer Dereference

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