Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98799 Overview
CVE-2026-98799 is a use-after-free vulnerability in the Linux kernel's BPF (Berkeley Packet Filter) trampoline subsystem. The flaw occurs because bpf_tramp_image_put() protects the trampoline image from being freed while a task runs inside it, but applies no equivalent protection to the BPF programs that the image calls. When a sleepable BPF program is detached while another task sleeps in a prior program within the same image, the detached program can be freed before the task resumes and invokes it. The issue was observed in production when programs attached through trampolines were detached while their hooks remained busy, and was independently reproduced by a fuzzer running with KASAN.
Critical Impact
A detached BPF program can be freed while a sleeping task still holds a pending call into it, producing a use-after-free that triggers an int3 fault on x86 and may enable kernel memory corruption.
Affected Products
- Linux kernel BPF subsystem (trampoline images and sleepable programs)
- Confirmed reproducible on Linux kernel 6.18.44 on x86_64
- Architecture-specific JIT paths on x86, arm64, powerpc, riscv, and loongarch
Discovery Timeline
- 2026-10-18 - CVE-2026-98799 published to NVD
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-98799
Vulnerability Analysis
The Linux kernel uses BPF trampolines to dispatch calls to attached fentry, fexit, and LSM programs. The function bpf_tramp_image_put() holds the image alive while any task may still be executing inside it, relying on RCU-style grace periods. The individual BPF programs called by that image do not receive the same guarantee.
When a program is detached, its last reference is dropped immediately and the program is freed after standard grace periods. The design assumes a task currently inside the traced function will skip fexit programs because the nop at ip_after_call has been patched to a jump. That assumption breaks when a task sleeps inside a sleepable BPF program that executes before the detached program in the call sequence.
After the sleeping task resumes, control returns to __bpf_prog_enter(P) for a program P that has already been freed. On x86, the freed slot in bpf_prog_pack memory is poisoned with int3 instructions, producing a fault such as Oops: int3: 0000 [#1] SMP NOPTI with bpf_lsm_bprm_committed_creds on the stack.
Root Cause
The trampoline teardown logic only tracked liveness of the image, not of each callee program. Sleepable programs can suspend execution across the detach boundary, so no grace period in the detach path waits for them. Any task still parked inside a prior sleepable program keeps a dangling pointer to subsequent programs in the original image's call list.
Attack Vector
Triggering the condition requires the ability to attach and detach BPF trampoline programs, typically restricted to privileged users with CAP_BPF or CAP_SYS_ADMIN. A local actor that can load sleepable BPF programs and race detach operations against active hooks can corrupt kernel memory or crash the system. The reporters reproduced the fault both in production workloads and with a fuzzer under KASAN.
The fix changes the JITs to emit a patchable nop in front of every program call sequence and records it in the image. When a program is detached, that nop is patched to a jump that skips the call site, allowing in-flight tasks to resume safely without touching freed memory. The trampoline retains a list of its prior images until they are freed so a detach can patch the nop in every image that may still host a sleeping task. On riscv and loongarch, where a long jump requires multiple instructions, arch_bpf_trampoline_skip() patches the single-instruction nop to a near branch to avoid resuming into a half-written sequence. The fix also lowers BPF_MAX_TRAMP_LINKS on x86 and arm64 so programs continue to fit within a page.
Detection Methods for CVE-2026-98799
Indicators of Compromise
- Kernel oops entries containing int3 faults with instruction pointers inside the bpf_prog_pack address range.
- Call stacks showing bpf_trampoline_* frames followed by bpf_lsm_* or other fentry/fexit targets at the time of the fault.
- KASAN reports flagging use-after-free in BPF program memory shortly after a BPF_PROG_DETACH or link destroy operation.
Detection Strategies
- Monitor dmesg and kernel crash reporters for Oops: int3 events with RIP values matching JITed BPF memory regions.
- Audit sequences of bpf() syscalls that attach sleepable programs to trampolines followed closely by detach operations on the same target.
- Correlate kernel panics with the running kernel version to identify hosts still on unpatched builds.
Monitoring Recommendations
- Enable kernel.panic_on_oops in test fleets to catch exploit attempts and gather crash dumps for triage.
- Collect eBPF audit telemetry including program load, attach, and detach events via bpf_audit or equivalent logging.
- Alert on unprivileged processes acquiring CAP_BPF or on unexpected sleepable LSM program loads outside approved tooling.
How to Mitigate CVE-2026-98799
Immediate Actions Required
- Apply the upstream kernel patches referenced below as soon as vendor builds become available.
- Inventory hosts running kernels that include sleepable BPF LSM programs and prioritize them for patching.
- Restrict CAP_BPF and CAP_SYS_ADMIN to trusted service accounts and remove it from general workloads.
Patch Information
The fix is published in the stable kernel tree. Review the upstream commits for implementation details: Kernel Git Commit 17637e1 and Kernel Git Commit 967566a. The patches add a patchable nop before each program call sequence and track image lists so detach can safely divert in-flight tasks across all prior images.
Workarounds
- Disable loading of sleepable BPF LSM programs on affected hosts where operationally feasible.
- Avoid detaching BPF trampoline programs during active workloads until the patched kernel is deployed.
- Use kernel lockdown mode or seccomp policies to block the bpf() syscall for non-essential processes.
# Example: restrict bpf() syscall access to root only on affected hosts
sysctl -w kernel.unprivileged_bpf_disabled=1
# Verify running kernel version against patched build
uname -r
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

