* [PATCH] sched_ext: Fix missing return after scx_error() in scx_dsq_move()
@ 2026-03-26 1:29 Cheng-Yang Chou
2026-03-26 2:38 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Cheng-Yang Chou @ 2026-03-26 1:29 UTC (permalink / raw)
To: sched-ext, Tejun Heo, David Vernet, Andrea Righi, Changwoo Min
Cc: Ching-Chun Huang, Chia-Ping Tsai, yphbchou0911
When scx_bpf_dsq_move[_vtime]() is called on a task that belongs to a
different scheduler, scx_error() is invoked to flag the violation.
scx_error() schedules an asynchronous scheduler teardown via irq_work
and returns immediately, so execution falls through and the DSQ move
proceeds on a cross-scheduler task regardless, potentially corrupting
DSQ state.
Add the missing return false so the function exits right after
reporting the error, consistent with the other early-exit checks in
the same function (e.g. scx_vet_enq_flags() failure at the top).
Fixes: bb4d9fd55158 ("sched_ext: scx_dsq_move() should validate the task belongs to the right scheduler")
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
kernel/sched/ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 551bfb99157d..a5d8871ac865 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -8094,6 +8094,7 @@ static bool scx_dsq_move(struct bpf_iter_scx_dsq_kern *kit,
if (unlikely(!scx_task_on_sched(sch, p))) {
scx_error(sch, "scx_bpf_dsq_move[_vtime]() on %s[%d] but the task belongs to a different scheduler",
p->comm, p->pid);
+ return false;
}
/*
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sched_ext: Fix missing return after scx_error() in scx_dsq_move()
2026-03-26 1:29 [PATCH] sched_ext: Fix missing return after scx_error() in scx_dsq_move() Cheng-Yang Chou
@ 2026-03-26 2:38 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2026-03-26 2:38 UTC (permalink / raw)
To: Cheng-Yang Chou, sched-ext; +Cc: linux-kernel
Applied to sched_ext/for-7.1.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-26 2:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 1:29 [PATCH] sched_ext: Fix missing return after scx_error() in scx_dsq_move() Cheng-Yang Chou
2026-03-26 2:38 ` 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.