All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] sched_ext: two more context-safety fixes found in the NMI kfunc audit
@ 2026-09-03  3:29 Wanwu Li
  2026-09-03  3:57 ` [PATCH 1/2] sched_ext: Make scx_locked_rq() return NULL from NMI Wanwu Li
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wanwu Li @ 2026-09-03  3:29 UTC (permalink / raw)
  To: tj, arighi, void, changwoo, emil; +Cc: liwanwu, sched-ext, linux-kernel

Continuing the audit that the sashiko bot kicked off on the NMI-reject
series, I went through every kfunc exposed to BPF_PROG_TYPE_TRACING
(the any / idle / cid context-filter sets). Two more context-safety
issues came out of it; this pair addresses both.

 - Patch 1 fixes the scx_locked_rq() class (three "any"-category kfuncs
   read scx_locked_rq() and take an unsafe fast path on a non-NULL
   return from NMI). scx_locked_rq() gains an in_nmi() test at the
   source that returns NULL from NMI, so the three callers fall onto
   their unlocked paths. This supersedes guarding them individually.

 - Patch 2 fixes an IRQ re-entrancy race on the per-CPU
   per_cpu_unvisited nodemask scratch in the idle path. The search
   scratch is protected only by preempt_disable(), which doesn't mask
   IRQs; switch to irqsave instead. The NMI case is left as-is (a
   misuse with no legitimate use and no crash risk).

Wanwu Li (2):
  sched_ext: Make scx_locked_rq() return NULL from NMI
  sched_ext: Protect the idle-search scratch nodemask with irqsave

 kernel/sched/ext/idle.c     | 14 ++++++++++++--
 kernel/sched/ext/internal.h |  9 +++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-03 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  3:29 [PATCH 0/2] sched_ext: two more context-safety fixes found in the NMI kfunc audit Wanwu Li
2026-09-03  3:57 ` [PATCH 1/2] sched_ext: Make scx_locked_rq() return NULL from NMI Wanwu Li
2026-09-03  4:18   ` sashiko-bot
2026-09-03  7:05     ` liwanwu
2026-09-03  3:57 ` [PATCH 2/2] sched_ext: Protect the idle-search scratch nodemask with irqsave Wanwu Li
2026-09-03 18:42 ` [PATCH 0/2] sched_ext: two more context-safety fixes found in the NMI kfunc audit Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.