Re: [PATCH] sched_ext: Fix NULL pointer deref and warnings during scx teardown

From: Tejun Heo

Date: Wed Feb 04 2026 - 15:09:06 EST


On Tue, Feb 03, 2026 at 03:01:30PM +0100, Andrea Righi wrote:
> > Nope, I can still trigger this (with the same modified scx_simple +
> > stress-ng --race-sched 0:
>
> A quick reproducer:
> https://github.com/sched-ext/scx/tree/scx-bug
>
> $ make
> $ vng -vr -- "stress-ng --race-sched 0 & ./build/scheds/c/scx_bug"
> ...
> [ 3.375119] BUG: kernel NULL pointer dereference, address: 00000000000001c0
> [ 3.375836] RIP: 0010:set_cpus_allowed_scx+0x1a/0xa0
>
> It happens almost immediately.

This should fix it:

http://lkml.kernel.org/r/fc034891cef55029c16122f4279e4057@xxxxxxxxxx

Thanks.

--
tejun