Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2026-139325

published

bpf: Forbid sleeping in hash map for_each callbacks

Published
30 Nov 2026, 13:33:43 UTC
Updated
30 Nov 2026, 13:33:43 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Linux — Linux314ee05e2fc601a7bece14376547d2b7a04bab67 to < b13b93f264ec9a700e22f91ada8313acc44ada2a · 314ee05e2fc601a7bece14376547d2b7a04bab67 to < 9bdd5e7f5d8313fa1f3a210621b4007bb5ad0ec6 · Other versions: unaffected Affected Not stated Linux
Linux — Linux5.13 (affected) · 0 to < 5.13 (unaffected · semver) · 7.3.6 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected Version-specific Not stated Linux
Amazon Linux AL2 Release evaluation Pending Fix; Not Affected Not stated Amazon Linux assessment
Amazon Linux AL2023 Release evaluation Pending Fix Not stated Amazon Linux assessment

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Forbid sleeping in hash map for_each callbacks A sleepable program (e.g. SEC("syscall"), lsm.s, fentry.s) can pass a callback to bpf_for_each_map_elem() on a hash map and call a sleepable helper or kfunc such as bpf_copy_from_user() from it. The verifier accepts this, but at run time the callback is invoked from inside an RCU read-side critical section: bpf_for_each_hash_elem() rcu_read_lock(); callback_fn(map, key, val, ctx, 0); bpf_copy_from_user() <- may fault and sleep rcu_read_unlock(); bpf_each_rhash_elem() does the same for BPF_MAP_TYPE_RHASH. Sleeping there triggers the "Voluntary context switch within RCU read-side critical section!" warning, delays grace periods, and with CONFIG_PREEMPT_RCU=n silently ends the read-side critical section that the bucket walk relies on. Synchronous callbacks are verified with the caller's state, so kernel/bpf/verifier.c:in_sleepable_context() only looks at the program's sleepability and the locks the program took itself, and does not know that the helper holds rcu_read_lock() around the callback. With a SEC("syscall") program whose callback reads a page that has to be read from disk first: BUG: sleeping function called from invalid context at include/linux/uaccess.h:169 RCU nest depth: 1, expected: 0 __might_fault+0x29/0x80 _copy_from_user+0x26/0x90 bpf_copy_from_user+0x23/0x60 bpf_prog_17d44fa39eebd6cc_cb+0x35/0x46 bpf_for_each_hash_elem+0xdb/0x280 Fix by marking the callback frame of hash map iteration as running under RCU and making in_sleepable_context() false while such a frame is on the call stack, so sleepable helpers, kfuncs and global functions are rejected there as inside bpf_rcu_read_lock(). The rules for trusting RCU protected pointers are left alone, which is conservative and keeps callbacks that verify today and do not sleep working. The flag is compared in func_states_equal() so that pruning never mixes the two contexts. Array map callbacks run without any lock and keep the caller's context.

en · Linux · cna

Vendor advisories explicitly linked to this CVE.

0

No linked advisories were found for this CVE.

Assessment

CVSS risk assessment and additional context for this vulnerability.

No normalized assessments.

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
Linux Linux 314ee05e2fc601a7bece14376547d2b7a04bab67 to < b13b93f264ec9a700e22f91ada8313acc44ada2a (affected · git)314ee05e2fc601a7bece14376547d2b7a04bab67 to < 9bdd5e7f5d8313fa1f3a210621b4007bb5ad0ec6 (affected · git)Default: unaffected Linux · cna
Linux Linux 5.13 (affected)0 to < 5.13 (unaffected · semver)7.3.6 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected Linux · cna

Weaknesses

0

No weakness assertions.

References

2

Provider assertions

1

Linux · cna

bpf: Forbid sleeping in hash map for_each callbacks

Provenance

Schema
5.2
Searchable
yes
Content hash
da0e1cef862faec4917f8bc380c8fb990b79e4cb9c4b836cbf044d7d2d598f2c
Ingested
30 Nov 2026, 13:42:23 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected