Skip to main content
Vulnerability Database/CVE-2026-98641

CVE-2026-98641: Linux Kernel BPF ARM64 Privilege Escalation

CVE-2026-98641 is a privilege escalation flaw in the Linux kernel's BPF implementation on ARM64 that affects frame pointer handling in exception callbacks. This post explains its impact, technical details, and mitigation steps.

Published:

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-98641 Overview

CVE-2026-98641 is a Linux kernel vulnerability in the arm64 BPF (Berkeley Packet Filter) just-in-time compiler. The flaw involves missing frame pointer setup in BPF exception callback prologues. When a BPF program acts as an exception boundary, build_prologue() takes the exception_cb path and never calls push_callee_regs(), so ctx->fp_used is not set and the callback prologue skips the mov x25, sp instruction that initializes BPF_REG_FP. A helper that receives the address of a local variable from such a callback can write over its own return address, leading to kernel memory corruption and a fatal panic.

Critical Impact

Local attackers with permission to load BPF programs on arm64 can trigger kernel memory corruption and a panic through crafted exception callbacks that pass stack addresses to helpers.

Affected Products

  • Linux kernel on arm64 (aarch64) architecture
  • Kernels that include BPF exception callback support with the arm64 JIT
  • Pre-patch builds referenced by commits b67b4c7, d7cd5eb, ecdd770, and ef1fb82

Discovery Timeline

  • 2026-10-18 - CVE-2026-98641 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98641

Vulnerability Analysis

The vulnerability resides in the arm64 BPF JIT prologue generation path for programs that serve as exception boundaries. A standard BPF program prologue invokes push_callee_regs(), which calls find_used_callee_regs(), the only location where ctx->fp_used is set. The exception callback path bypasses push_callee_regs() entirely because the exception boundary program has already saved all callee-saved registers.

Because ctx->fp_used is never set, the emitted callback prologue omits the mov x25, sp instruction that would point BPF_REG_FP at the callback's own frame. Register x25 instead retains whatever value it held when bpf_throw() was invoked. If the throw originated from a subprogram using its own BPF stack, x25 still references that subprogram's frame pointer, and because the subprogram never returns it never restores x25 either.

Root Cause

Stack accesses expressed through BPF_REG_FP are rewritten by the verifier to be stack-pointer relative, so they still land correctly in the callback's active frame. The problem surfaces when the register is materialized and handed to another function. Passing the address of a local variable to a helper gives that helper a pointer into the dead subprogram's frame, which now sits below the callback's current stack pointer and overlaps the helper's own call chain, including saved return addresses.

Attack Vector

A local attacker with the ability to load BPF programs crafts an exception callback that invokes a helper with a BPF_REG_FP relative address. The helper writes attacker-controlled data into memory that overlaps its own saved return address (lr). Control transfers to the attacker-supplied value on return, producing kernel panic traces similar to the reported pc : 0x1234 / lr : 0x1234 crash through bpf_test_run and __sys_bpf. The upstream fix sets ctx->fp_used on the exception callback path so the existing JIT logic emits the frame pointer setup, with the epilogue restoring x25 from the main program's save area alongside the other callee-saved registers.

Detection Methods for CVE-2026-98641

Indicators of Compromise

  • Unexpected kernel panic messages referencing bpf_test_run, bpf_prog_test_run_skb, or __sys_bpf in call traces on arm64 hosts
  • Crash logs showing identical pc and lr values pointing to attacker-controlled addresses
  • Audit records of unprivileged or container workloads loading BPF programs that use bpf_throw() exception callbacks

Detection Strategies

  • Monitor bpf() syscall activity on arm64 systems for programs that register exception callbacks and invoke helpers with stack-relative addresses
  • Correlate kernel oops events with recent BPF program loads from the same user namespace or container
  • Track kernel version and build metadata to flag arm64 hosts running pre-patch kernels in the vulnerable commit range

Monitoring Recommendations

  • Enable kernel.panic_on_oops and forward kernel ring buffer events to a central log store for arm64 fleets
  • Collect auditd records for bpf() syscalls and alert on unexpected BPF_PROG_LOAD operations outside allowlisted workloads
  • Review eBPF program loading telemetry across container platforms where unprivileged BPF or user namespaces are enabled

How to Mitigate CVE-2026-98641

Immediate Actions Required

  • Apply the upstream Linux kernel patches that set ctx->fp_used on the arm64 BPF exception callback path
  • Prioritize patching arm64 servers, cloud instances, and edge devices that permit unprivileged BPF program loading
  • Audit container and sandbox configurations to confirm which workloads can issue bpf() syscalls

Patch Information

The fix is distributed across multiple stable kernel branches. Reference the upstream commits: Kernel Git Commit b67b4c7, Kernel Git Commit d7cd5eb, Kernel Git Commit ecdd770, and Kernel Git Commit ef1fb82. The patches ensure the callback prologue emits mov x25, sp so BPF_REG_FP points at the callback's own frame, and the epilogue restores x25 from the main program's save area.

Workarounds

  • Restrict bpf() syscall access to privileged users by setting kernel.unprivileged_bpf_disabled=1
  • Disable or constrain user namespace creation (kernel.unprivileged_userns_clone=0) for untrusted workloads on arm64 hosts
  • Use seccomp or Linux Security Module policies to block bpf() for container workloads that do not require it
bash
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' > /etc/sysctl.d/90-bpf-hardening.conf
sysctl -w kernel.unprivileged_userns_clone=0
uname -m   # confirm arm64 / aarch64 before applying

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.