Kernel Kit / Infix / v26.10.0latest
CVE-2026-98799
—unknownlinux6.18.60 · 6.18.54 · 6.18.8 · 6.12.21in 4 of 4 releases
Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.
Reach linux · 8 builds in 4 of 4 releases
full reviewcross-check✓ a member decided
Description · NVD
bpf: Skip detached progs in trampoline images that are still in use
bpf_tramp_image_put() 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 ip_after_call 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, bpf_tramp_image_put(I)
bpf_prog_put(P), last ref
grace periods, P freed
back from S
__bpf_prog_enter(P)
call P->bpf_funcIf 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 bpf_prog_pack 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> ? bpf_trampoline_6442515411+0x1a4/0x21b bpf_lsm_bprm_committed_creds+0x5/0x10 security_bprm_committed_creds+0x5f/0x70 begin_new_exec+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 ip_after_call 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 arch_bpf_trampoline_skip().
With the extra nops, BPF_MAX_TRAMP_LINKS 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.
Published 2026-10-18NVD
The unfixed BPF trampoline code is compiled into the x86_64 kernel: kernel/bpf/trampoline.c and arch/x86/net/bpf_jit_comp.c still use the old ip_after_call scheme that the fix removes, and none of the 139 applied patches touches BPF.
The build has no CONFIG_DEBUG_INFO_BTF, no CONFIG_SECURITY/CONFIG_BPF_LSM and no CONFIG_FUNCTION_ERROR_INJECTION. So fentry/fexit/LSM programs cannot be attached to kernel functions, and the verifier rejects every sleepable trampoline program, which is the precondition the CVE describes.
The only way left to create a trampoline is a tracing or freplace program attached to another BPF program. That needs a root shell with CAP_BPF and CAP_PERFMON plus a custom loader; nothing in finit, confd/YANG or the CLI loads such programs, and it is not reachable from the network.
Evidence 12
The pre-fix logic is still present: only `im->ip_after_call` is patched to a jump on image release. There is no per-prog nop, no per-trampoline image list and no `arch_bpf_trampoline_skip()`.
output/build/linux-6.18.60/kernel/bpf/trampoline.c:338 (bpf_tramp_image_put)
The x86 JIT still records `im->ip_after_call`, which the fix removes, so the fix is not backported in 6.18.60 as built.
output/build/linux-6.18.60/arch/x86/net/bpf_jit_comp.c:3377
`BPF_MAX_TRAMP_LINKS` is still 38; the fix lowers it on x86.
output/build/linux-6.18.60/include/linux/bpf.h:1185
`kernel/bpf/trampoline.o` was built (`arch/x86/net/bpf_jit_comp.o` at line 24947), so the affected code is in the image.
output/objects.txt:21905
`CONFIG_BPF_SYSCALL=y` and `CONFIG_BPF_JIT=y` (line 119) enable `trampoline.o` via `kernel/bpf/Makefile:16`.
output/build/linux-6.18.60/.config:118
`CONFIG_PAHOLE_VERSION=0` and no `CONFIG_DEBUG_INFO_BTF` line anywhere in the file: the kernel has no vmlinux BTF.
output/build/linux-6.18.60/.config:25
Loading a program with `attach_btf_id` against the kernel fails with `-EINVAL` when `bpf_get_btf_vmlinux()` returns NULL, which it does without `CONFIG_DEBUG_INFO_BTF` (`kernel/bpf/verifier.c:24697`). fentry/fexit/fmod_ret on kernel functions is therefore unavailable.
output/build/linux-6.18.60/kernel/bpf/syscall.c:2968-2978
`# CONFIG_SECURITY is not set`, so there is no `CONFIG_BPF_LSM`: no LSM trampoline programs and no cgroup-LSM shim. `bpf_lsm_is_sleepable_hook()` is a stub returning false (`include/linux/bpf_lsm.h:63`).
output/build/linux-6.18.60/.config:4316
A sleepable tracing program is accepted only if its target is in the error-injection list or is a `KF_SLEEPABLE` modify-return kfunc. `CONFIG_FUNCTION_ERROR_INJECTION` is off (`.config:5029`), so `within_error_injection_list()` always returns false (`include/linux/error-injection.h:16`). No sleepable trampoline program can be loaded.
output/build/linux-6.18.60/kernel/bpf/verifier.c:24473-24509
`CONFIG_BPF_UNPRIV_DEFAULT_OFF=y`: `bpf()` needs privilege, and tracing program types additionally need `CAP_PERFMON` (`kernel/bpf/syscall.c:2944`).
output/build/linux-6.18.60/.config:122
Only `BR2_PACKAGE_BPFTOOL_ARCH_SUPPORTS` and `BR2_PACKAGE_BPFTRACE_ARCH_SUPPORTS` appear; bpftool, bpftrace and libbpf are not selected. The only BPF-capable userspace is iproute2 (`output/.config:3264`), which loads tc/XDP programs, not trampoline programs.
output/.config:617
A case-insensitive search for `bpf` returns nothing: no YANG node, confd code or finit service loads or attaches BPF programs.
src/confd/yang, src/confd/src, board/common/rootfs/etc
Version and patches
The tree is plain linux 6.18.60 (output/build/linux-6.18.60/Makefile: 6.18.60). The CVE's own trace is from 6.18.44, so the 6.18.y line is affected.
I could not read the upstream fix commits (17637e1a581a, 967566ad325b) from this tree, so the fixed stable version is unknown. The source itself shows the fix is absent: ip_after_call is still used and there is no arch_bpf_trampoline_skip().
output/build/linux-6.18.60/.applied_patches_list has 139 entries and none matches bpf or tramp.
Recommendation
Document as not exposed in the x86_64 image; no urgent backport is needed. Pick up the fix through the next routine 6.18.y stable bump that contains it.
Re-evaluate if the kernel config ever gains CONFIG_DEBUG_INFO_BTF, CONFIG_BPF_LSM or CONFIG_FUNCTION_ERROR_INJECTION, or if a BPF tracing tool such as bpftrace or bpftool is added to the image.
This review covers only board/x86_64/linux_defconfig; check the other board defconfigs separately.
Open questions
The fix commits and the kernel CNA affected range could not be read from this tree, so the first fixed 6.18.y release is not confirmed.
The CVE describes the trigger as a task sleeping in a sleepable program, which this build cannot load. I did not establish whether a task preempted between two non-sleepable programs in one trampoline (CONFIG_PREEMPT=y) could hit the same use-after-free. Even if it can, it would still require root with CAP_BPF and CAP_PERFMON attaching fentry/fexit programs to another BPF program, so the verdict stays the same.
Two of my combined shell commands were refused by the sandbox; I re-ran the same read-only searches as separate grep calls, so no evidence is missing.
Members of Kernel Kit decide. Sign in if you are one.