CVE-2026-98220
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
06/10/2026
Last modified:
19/10/2026
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
sched_ext: Fix NULL sched deref in kfunc sub-sched error paths<br />
<br />
When the root scheduler has sub-scheds attached, the COMPAT kfunc<br />
wrappers scx_bpf_select_cpu_and() and scx_bpf_dsq_insert_vtime() refuse<br />
the call and report to @p&#39;s scheduler:<br />
<br />
scx_error(scx_task_sched(p), "... must be used");<br />
<br />
The wrappers are reachable with tasks that have no scheduler.<br />
scx_bpf_select_cpu_and() is in the select_cpu kfunc group, which<br />
scx_kfunc_context_filter() opens to BPF_PROG_TYPE_SYSCALL programs;<br />
scx_bpf_dsq_insert_vtime() is in the enqueue_dispatch group, which<br />
ops.enqueue() and ops.dispatch() may call with any KF_RCU task -- the<br />
group has no kf_tasks validation, and scx_dsq_insert_preamble() checks<br />
task ownership with scx_task_on_sched() precisely because @p may be an<br />
arbitrary task.<br />
<br />
scx_task_sched(p) is p->scx.sched, which is NULL for tasks past<br />
sched_ext_dead() -- which clears it via scx_disable_and_exit_task() on<br />
exit -- and for idle tasks, which the enable paths skip as they are<br />
never scheduled through SCX. It is also an rcu_dereference_protected()<br />
that expects @p&#39;s pi_lock or rq lock, which neither wrapper holds.<br />
Passing NULL to scx_error() reaches scx_vexit(), which dereferences<br />
sch->exit_info, oopsing the kernel.<br />
<br />
One concrete trigger exercised while developing the fix: a<br />
BPF_PROG_TYPE_SYSCALL program calling the select_cpu_and wrapper on an<br />
exited-but-not-reaped task while a sub-scheduler was attached (its pid<br />
stays findable while the zombie is unreaped; faulting instruction is<br />
the scx_vexit() prologue "mov r15,[rdi+0x398]" with RDI=NULL and 0x398<br />
the offset of sch->exit_info):<br />
<br />
sched_ext: BPF scheduler "kfunc_subsched_null" enabled<br />
sched_ext: BPF sub-scheduler "kfunc_subsched_null" enabled<br />
sched_ext: Unassociated program run_select_cpu_ (id 76)<br />
BUG: kernel NULL pointer dereference, address: 0000000000000398<br />
#PF: supervisor read access in kernel mode<br />
#PF: error_code(0x0000) - not-present page<br />
Oops: Oops: 0000 [#1] SMP NOPTI<br />
CPU: 7 UID: 0 PID: 8201 Comm: kfunc_test_runn Tainted: G W<br />
RIP: 0010:scx_vexit+0x25/0xa0<br />
Code: ... 8b bf 98 03 00 00 ...<br />
CR2: 0000000000000398<br />
Call Trace:<br />
<br />
__scx_exit+0x4f/0x70<br />
scx_bpf_select_cpu_and+0xab/0xb0<br />
bpf_prog_430ed61a7b66e03a_run_select_cpu_and+0x9c/0xe7<br />
? __x64_sys_bpf+0x2c/0x40<br />
bpf_prog_test_run_syscall+0x130/0x2f0<br />
__sys_bpf+0x930/0x10d0<br />
? __x64_sys_bpf+0x2c/0x40<br />
__x64_sys_bpf+0x2c/0x40<br />
do_syscall_64+0xbc/0x460<br />
entry_SYSCALL_64_after_hwframe+0x76/0x7e<br />
<br />
<br />
Read @p&#39;s scheduler under RCU instead, which the wrappers can do from<br />
their guard(rcu)(): fault it when it can be determined, and when it<br />
can&#39;t be determined -- @p is a task past sched_ext_dead() or an idle<br />
task -- there is nothing obviously wrong to report, so just refuse the<br />
call as before without faulting any scheduler.<br />
<br />
These COMPAT wrappers are scheduled for eventual removal once the<br />
deprecation grace period elapses, but until then -- and regardless of<br />
their removal timeline -- they must not oops the kernel on a task they<br />
are handed.


