diff options
| author | Tejun Heo <tj@kernel.org> | 2026-05-12 02:18:19 +0300 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-05-13 00:28:56 +0300 |
| commit | b273b75b8d677aea06dd06d80b61b3bb06e94680 (patch) | |
| tree | f74629178fcefc0be3f64b6ac2d1087b8f3bf371 | |
| parent | 39e25a2100604320e8d9df54c6c31258f7a3df29 (diff) | |
| download | linux-b273b75b8d677aea06dd06d80b61b3bb06e94680.tar.xz | |
sched_ext: INIT_LIST_HEAD() &sch->all in scx_alloc_and_add_sched()
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>
| -rw-r--r-- | kernel/sched/ext.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index 68120f679178..6d69ba29cfd7 100644 --- a/kernel/sched/ext.c +++ b/kernel/sched/ext.c @@ -6635,6 +6635,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); |
