Re: [PATCH 2/2] sched_ext: Fix TOCTOU on p->scx.dsq in scx_dump_task()

From: Tejun Heo

Date: Fri Feb 27 2026 - 13:35:23 EST


On Thu, Feb 26, 2026 at 05:26:40AM +0000, David Carlier wrote:
> p->scx.dsq is checked for NULL then dereferenced without
> synchronization. Another CPU can NULL the pointer between the check
> and the use. Use READ_ONCE() to capture the pointer into a local
> variable before dereferencing.

Aren't we holding rq lock for the task? David, are these patches AI
generated? I'm not against AI generated patches but a human gotta verify it
end-to-end.

Thanks.

--
tejun