CVE-2026-143365: bpf: Clamp the trace length in __bpf_get_stack() again

Published Dec 3, 2026
·
Updated

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

bpf: Clamp the trace length in bpfgetstack() again

getperfcallchain() and getcallchainentryfortask() store a trace in a per-CPU entry, one per context. They release the entry before they return it. Thus a second user in the same context can write to the entry while the first user reads it. preemptdisable() stops only other tasks.

bpfgetstack() requests at most maxdepth frames. This is skip plus the frames that fit in the buffer, but not more than perfeventmaxstack. Since the commit below, it copies 'trace->nr - skip' frames with no limit. But a second user can store a longer trace. The unwinders of PowerPC add context markers that maxdepth does not limit. In both cases the copy writes after the end of the buffer.

Read trace->nr one time. Clamp the value to maxdepth before the skip test, as bpfgetstackpe() does. Thus when maxdepth is less than skip, the helper returns -EFAULT, and 'tracenr - skip' does not underflow. The copied frames can still be those of the second user.

Affected Software

5 affected componentsFixes available
Linux Linux kernel
linux/kernel>=6.12.63<6.12.120
6.12.120
linux/kernel>=6.17.13<6.18
6.18
linux/kernel>=6.18.2<6.18.66
6.18.66
linux/kernel>=6.19.0<7.3.7
7.3.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.120
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.66
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.7

Event History

Dec 3, 2026
CVE Published
via MITRE·09:22 AM
Data Sourced
via MITRE·09:22 AM
Description
Data Sourced
via OSV·09:22 AM
DescriptionAffected Software
Data Sourced
via NVD·10:18 AM
Description

Frequently Asked Questions

1

What conditions trigger the out-of-bounds copy?

The issue requires a second user in the same context to write a longer stack trace into the shared per-CPU trace entry while the first user is reading it. The affected path can then copy more frames than fit in the caller's buffer.

2

Does disabling preemption prevent this race?

No. preempt_disable() prevents other tasks from running, but it does not prevent another user in the same context from updating the per-CPU trace entry.

3

What changes after applying the fix?

The trace frame count is read once and clamped to max_depth before skip handling and copying. If max_depth is smaller than skip, the helper returns -EFAULT rather than allowing an underflow or oversized copy.

4

Can the returned stack still contain frames from another user after the fix?

Yes. The fix prevents copying beyond the buffer, but the copied frames can still be those written by the second user.

5

How can I determine whether the fix is present?

Check whether the kernel source or applied stable patches include any of the referenced commits: 7735e81c34d7aed929b4a3864941f675f34ea07f, 5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9, or f9045c09e95923b91d99916f0c821a4efbff4be4.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203