The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH sched_ext/for-7.1-fixes] sched_ext: INIT_LIST_HEAD() &sch->all in scx_alloc_and_add_sched()
@ 2026-05-11 23:18 Tejun Heo
  0 siblings, 0 replies; only message in thread
From: Tejun Heo @ 2026-05-11 23:18 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel

On scx_link_sched() error paths (parent disabled, hash insert failure),
&sch->all is never added to scx_sched_all. The cleanup path runs
scx_unlink_sched() unconditionally, which calls list_del_rcu(&sch->all) on a
list_head that was never initialized triggering a corruption warning.

Initialize &sch->all.

Fixes: 54be8de4236a ("sched_ext: Factor out scx_link_sched() and scx_unlink_sched()")
Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kernel/sched/ext.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 9354da79e162..1fb3329ae2b4 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -6643,6 +6643,7 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops,
 	rcu_assign_pointer(ops->priv, sch);

 	sch->kobj.kset = scx_kset;
+	INIT_LIST_HEAD(&sch->all);

 #ifdef CONFIG_EXT_SUB_SCHED
 	char *buf = kzalloc(PATH_MAX, GFP_KERNEL);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-11 23:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 23:18 [PATCH sched_ext/for-7.1-fixes] sched_ext: INIT_LIST_HEAD() &sch->all in scx_alloc_and_add_sched() Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox