]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched_ext: idle: Validate locking correctness in scx_bpf_select_cpu_and()
authorAndrea Righi <arighi@nvidia.com>
Thu, 15 May 2025 19:11:43 +0000 (21:11 +0200)
committerTejun Heo <tj@kernel.org>
Tue, 20 May 2025 20:24:05 +0000 (10:24 -1000)
commit686d1337237161833684d8554c6e3ea2d692bd41
treea6049e6c59698850afb8b8a7df429ac516c9daee
parent617a77018f683905ed4e8cd693df51243908353f
sched_ext: idle: Validate locking correctness in scx_bpf_select_cpu_and()

Validate locking correctness when accessing p->nr_cpus_allowed and
p->cpus_ptr inside scx_bpf_select_cpu_and(): if the rq lock is held,
access is safe; otherwise, require that p->pi_lock is held.

This allows to catch potential unsafe calls to scx_bpf_select_cpu_and().

Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/sched/ext_idle.c