CVE-2026-98799: bpf: Skip detached progs in trampoline images that are still in use

Published Oct 18, 2026
·
Updated

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

bpf: Skip detached progs in trampoline images that are still in use

bpftrampimageput() makes sure a trampoline image is not freed while a task may still be running in it, but nothing similar is done for the progs called by that image. Detach drops the last prog reference right away and the prog is freed after grace periods, on the basis that a task still in the traced function skips the fexit progs once the nop at ipaftercall is patched to a jump.

That leaves out a task sleeping in a sleepable prog that runs before the detached one, which no grace period waits for:

CPU 0 CPU 1 in image I, sleeping in prog S detach P from I's trampoline -> new image, bpftrampimageput(I) bpfprogput(P), last ref grace periods, P freed back from S bpfprogenter(P) call P->bpffunc

If S and P are fexit progs the task is already past the patched jump, and fentry only images don't have one. On x86 this is an int3 in poisoned bpfprogpack memory:

Oops: int3: 0000 [#1] SMP NOPTI CPU: 18 UID: 0 PID: 94573 Comm: x169 Not tainted 6.18.44 #1 PREEMPT(lazy) RIP: 0010:0xffffffffc0601d8d Call Trace: <TASK> ? bpftrampoline6442515411+0x1a4/0x21b bpflsmbprmcommittedcreds+0x5/0x10 securitybprmcommittedcreds+0x5f/0x70 beginnewexec+0x2d6/0x410 ...

We hit this in production when progs attached through trampolines got detached while their hooks were busy, and it was independently found with a fuzzer and KASAN.

Have the JITs emit a patchable nop in front of each prog call sequence and record it in the image. When a prog is detached, patch its nop to a jump over the call sequence. Progs that stay attached keep running for the tasks that are in the image, and ipaftercall isn't needed anymore.

The task can be in any image that isn't freed yet, not only in the current one. It sleeps in image I1 that calls S, P and Q, then P is detached and the trampoline moves to image I2, then Q is detached and its call is still in I1. So the trampoline keeps a list of its images until they are freed, and detaching a prog patches its nop in all of them. Images hold a reference on the trampoline for that long.

On riscv and loongarch a jump of any range takes several instructions, and a task preempted in the middle of them could resume into half of the new sequence. The nop is a single instruction there, patched to a near branch through archbpftrampolineskip().

With the extra nops, BPFMAXTRAMPLINKS progs no longer fit in a page on x86 and arm64 (and already didn't on powerpc), so lower the limit there like s390 does.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Update BPF trampoline handling so JITs emit a patchable NOP before each program call sequence; when a program is detached, patch that NOP to jump over the call sequence, keep trampoline images referenced while tasks may still execute them, and skip detached programs in images that remain in use.

  2. Compensating control

    Lower BPF_MAX_TRAMP_LINKS to account for the additional NOPs so the trampoline call sequences continue to fit within a page.

Event History

Oct 18, 2026
CVE Published
via MITRE·03:48 PM
Data Sourced
via MITRE·03:48 PM
Description
Data Sourced
via NVD·04:17 PM
Description

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