Linux kernel BPF stack map OOB write due to trace length clamp
CVE-2026-143364 Published on December 3, 2026
bpf: Clamp the trace length before the skip test in stackid_init()
In the Linux kernel, the following vulnerability has been resolved:
bpf: Clamp the trace length before the skip test in stackid_init()
stackid_init() gives a bucket of the stack map
min(trace_nr - skip, max_depth - skip) trace entries. Here max_depth is the
size of a bucket plus skip, but at most perf_event_max_stack. Context
markers can make trace_nr larger than that, so the skip test can pass when
max_depth < skip. Then 'max_depth - skip' wraps, and the kernel can write
after the bucket.
Clamp trace_nr to max_depth before the skip test, as __bpf_get_stack_pe()
does. The result changes only when skip >= max_depth. Then it is -EFAULT.
Until now skip == max_depth could give the id of an empty trace.
get_perf_callchain() releases the trace, so an NMI can change trace->nr.
Use READ_ONCE() in bpf_get_stackid(), so the compiler reads it one time.
Products Associated with CVE-2026-143364
Want to know whenever a new CVE is published for Linux Kernel? stack.watch will email you.
Affected Versions
Linux:- Version d1f424a77b6bd27b361737ed73df49a0158f1590 and below 7203b3225a0533d1cfd89dd4695ff80947ad16a7 is affected.
- Version 4669a8db976c8cbd5427fe9945f12c5fa5168ff3 and below a18b920a21163cfcef67d3913c87ce53894dc19c is affected.
- Version 23f852daa4bab4d579110e034e4d513f7d490846 and below f624585522f6fe93823a3feea28ce3b4ace9e77a is affected.
- Version 23f852daa4bab4d579110e034e4d513f7d490846 and below a08ba2ab79dffd92c32d3f2dadfc7eba03625a2b is affected.
- Version 03fe4c886667b3a09b9d6afc03bbc68afb35c82b is affected.
- Version d6028caa0ee39dccd005468adfa3223b92bd3ad3 is affected.
- Version 2a008f6de163279deffd488c1deab081bce5667c is affected.
- Version 6.12.63 and below 6.12.120 is affected.
- Version 6.18.2 and below 6.18.66 is affected.
- Version 6.1.191 and below 6.2 is affected.
- Version 6.6.160 and below 6.7 is affected.
- Version 6.17.13 and below 6.18 is affected.
- Version 6.19 is affected.
- Before 6.19 is unaffected.
- Version 6.12.120, <= 6.12.* is unaffected.
- Version 6.18.66, <= 6.18.* is unaffected.
- Version 7.3.7, <= 7.3.* is unaffected.
- Version 7.4-rc2, <= * is unaffected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.