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

CVE-2026-98220: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98220 is a use-after-free flaw in the Linux kernel scheduler that can cause NULL pointer dereferences and system crashes. This article covers the technical details, affected versions, 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-98220 Overview

CVE-2026-98220 is a NULL pointer dereference vulnerability in the Linux kernel's sched_ext subsystem. The flaw affects the COMPAT kfunc wrappers scx_bpf_select_cpu_and() and scx_bpf_dsq_insert_vtime() when a root scheduler has sub-schedulers attached. These wrappers pass a task's scheduler reference to scx_error() without validating that the pointer is non-NULL. Tasks past sched_ext_dead() and idle tasks carry a NULL p->scx.sched, causing the kernel to oops when scx_vexit() dereferences sch->exit_info. The condition is reachable from BPF_PROG_TYPE_SYSCALL programs and from ops.enqueue() or ops.dispatch() callbacks that receive arbitrary KF_RCU tasks.

Critical Impact

Local triggering of a kernel NULL pointer dereference leads to an oops and denial of service on systems running sched_ext BPF schedulers with sub-schedulers attached.

Affected Products

  • Linux kernel versions containing the sched_ext subsystem with COMPAT kfunc wrappers
  • Systems running BPF schedulers with sub-scheduler attachments
  • Kernels built with CONFIG_SCHED_CLASS_EXT enabled

Discovery Timeline

  • 2026-10-06 - CVE-2026-98220 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98220

Vulnerability Analysis

The vulnerability resides in the extensible scheduler class (sched_ext) subsystem, which allows BPF programs to implement custom CPU schedulers. When a root scheduler has sub-schedulers attached, two COMPAT kfunc wrappers refuse the call and attempt to report the error back to the task's scheduler by invoking scx_error(scx_task_sched(p), "... must be used").

The scx_task_sched(p) helper returns p->scx.sched, which is NULL for two classes of tasks: tasks past sched_ext_dead() where scx_disable_and_exit_task() has cleared the field, and idle tasks that are never scheduled through SCX. When scx_error() is invoked with a NULL scheduler, control flow reaches scx_vexit(), which dereferences sch->exit_info and triggers a kernel NULL pointer dereference at offset 0x398.

Root Cause

The root cause is a missing NULL check combined with an incorrect locking assumption. scx_task_sched(p) is an rcu_dereference_protected() call that expects the caller to hold p->pi_lock or the runqueue lock. Neither COMPAT wrapper holds these locks. The scx_bpf_select_cpu_and() wrapper belongs to the select_cpu kfunc group, which scx_kfunc_context_filter() opens to BPF_PROG_TYPE_SYSCALL programs. The scx_bpf_dsq_insert_vtime() wrapper belongs to the enqueue_dispatch group with no kf_tasks validation, allowing arbitrary KF_RCU tasks through.

Attack Vector

A local attacker with permission to load BPF_PROG_TYPE_SYSCALL programs can trigger the oops by invoking scx_bpf_select_cpu_and() against an exited-but-unreaped task while a sub-scheduler is attached. The zombie task's PID remains discoverable until reaping, enabling the attacker to pass a task reference whose p->scx.sched has already been cleared. The faulting instruction mov r15,[rdi+0x398] in the scx_vexit() prologue dereferences RDI=NULL and crashes the kernel. The fix reads the scheduler reference under RCU within the wrappers' guard(rcu)() scope and gracefully refuses the call when no scheduler can be identified.

Detection Methods for CVE-2026-98220

Indicators of Compromise

  • Kernel oops entries referencing scx_vexit+0x25/0xa0 with CR2: 0000000000000398
  • Call traces containing __scx_exit, scx_bpf_select_cpu_and, or scx_bpf_dsq_insert_vtime
  • Kernel log messages such as sched_ext: Unassociated program followed by a NULL pointer dereference
  • Unexpected system crashes on hosts running BPF schedulers with sub-schedulers attached

Detection Strategies

  • Monitor dmesg and /var/log/kern.log for BUG: kernel NULL pointer dereference entries involving sched_ext symbols
  • Audit loaded BPF programs with bpftool prog list to inventory BPF_PROG_TYPE_SYSCALL programs that invoke SCX kfuncs
  • Correlate kernel panic telemetry with the presence of enabled sched_ext BPF schedulers and sub-schedulers

Monitoring Recommendations

  • Collect kernel crash dumps via kdump to capture the RIP and faulting address for post-incident analysis
  • Track BPF program load events through audit subsystem rules targeting the bpf() syscall
  • Alert on kernel log messages matching sched_ext: BPF sub-scheduler enable or disable events on production hosts

How to Mitigate CVE-2026-98220

Immediate Actions Required

  • Apply the upstream kernel patches referenced below as soon as updated packages are available from your distribution
  • Restrict BPF_PROG_TYPE_SYSCALL program loading to privileged users by enforcing CAP_BPF and CAP_SYS_ADMIN controls
  • Disable or unload sched_ext BPF schedulers with sub-schedulers until the patch is deployed

Patch Information

The fix reads the task's scheduler under RCU within the wrappers' existing guard(rcu)() section. When a scheduler can be identified it is faulted; when the task is past sched_ext_dead() or is an idle task, the call is refused without touching any scheduler. Upstream fixes are available in the Linux kernel commits 0a85182 and 589f094.

Workarounds

  • Unload sched_ext BPF schedulers using scx_loader disable commands or by terminating the user-space scheduler process
  • Prevent unprivileged BPF access by setting kernel.unprivileged_bpf_disabled=1 via sysctl
  • Avoid attaching sub-schedulers in production until patched kernels are deployed across the fleet
bash
# Configuration example
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' >> /etc/sysctl.d/99-bpf-hardening.conf

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.