Re: [PATCH 2/2] sched_ext: Fix TOCTOU on p->scx.dsq in scx_dump_task()
From: David CARLIER
Date: Fri Feb 27 2026 - 13:42:04 EST
Hi,
On Fri, 27 Feb 2026 at 18:33, Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> 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.
I used AI only to learn quicker the kernel internals as I never
contributed to it before.
So I double-checked and you are right, sorry for the noise.
Cheers !
>
> Thanks.
>
> --
> tejun