Re: [PATCH v4 sched_ext/for-7.3 20/40] sched_ext: Stop resolving a disabled scheduler's programs

Tejun Heo <[email protected]>
Newsgroups dev.linux.lists.sched-ext,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, 08 Jul 2026 21:55:20 +0000, [email protected] wrote:
> - [High] The `sch->dead` check was omitted from the
> `!CONFIG_EXT_SUB_SCHED` fallback version of `scx_prog_sched()`, leaving
> the Use-After-Exit hazard unfixed.

Good catch. The =n stub skips the dead check, making the post-exit drain
this patch adds a no-op there. Fixed in v5 - the stub now returns NULL
for a dead root like the =y version.

> This is a pre-existing issue, but can a parent scheduler bypass the
> newly introduced dead flag and invoke a torn-down child scheduler's
> ops.dispatch()?

Not reachable: scx_sub_disable() unlinks the child from the sub hash
before setting dead, so scx_find_sub_sched() already returns NULL in the
claimed window and scx_bpf_sub_dispatch() bails before ops.dispatch().
That path is gated by hash membership; a dead check there would be
redundant.

Thanks.

-- 
tejun
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.