linux-stable/kernel
Tejun Heo 57ec081869 sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group()
commit 33796b9187 upstream.

During task_group creation, sched_create_group() calls
scx_group_set_weight() with CGROUP_WEIGHT_DFL to initialize the sched_ext
portion. This is premature and ends up calling ops.cgroup_set_weight() with
an incorrect @cgrp before ops.cgroup_init() is called.

sched_create_group() should just initialize SCX related fields in the new
task_group. Fix it by factoring out scx_tg_init() from sched_init() and
making sched_create_group() call that function instead of
scx_group_set_weight().

v2: Retain CONFIG_EXT_GROUP_SCHED ifdef in sched_init() as removing it leads
    to build failures on !CONFIG_GROUP_SCHED configs.

Signed-off-by: Tejun Heo <tj@kernel.org>
Fixes: 8195136669 ("sched_ext: Add cgroup support")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:11:38 +01:00
..
bpf bpf: Use proper type to calculate bpf_raw_tp_null_args.mask index 2025-06-27 11:11:33 +01:00
cgroup cgroup,freezer: fix incomplete freezing when attaching tasks 2025-06-27 11:11:19 +01:00
configs
debug
dma
entry
events perf: Ensure bpf_perf_link path is properly serialized 2025-06-19 15:32:32 +02:00
futex
gcov
irq
kcsan
livepatch
locking
module
power PM: sleep: Print PM debug messages during hibernation 2025-06-19 15:31:32 +02:00
printk printk: Check CON_SUSPEND when unblanking a console 2025-05-29 11:02:22 +02:00
rcu rcu/cpu_stall_cputime: fix the hardirq count for x86 architecture 2025-06-19 15:31:30 +02:00
sched sched_ext, sched/core: Don't call scx_group_set_weight() prematurely from sched_create_group() 2025-06-27 11:11:38 +01:00
time clocksource: Fix the CPUs' choice in the watchdog per CPU verification 2025-06-27 11:11:26 +01:00
trace ftrace: Fix UAF when lookup kallsym after ftrace disabled 2025-06-27 11:11:23 +01:00
.gitignore
acct.c
async.c
audit_fsnotify.c
audit_tree.c
audit_watch.c
audit.c
audit.h
auditfilter.c
auditsc.c
backtracetest.c
bounds.c
capability.c
cfi.c
compat.c
configs.c
context_tracking.c
cpu_pm.c
cpu.c
crash_core.c
crash_reserve.c
cred.c
delayacct.c
dma.c
elfcorehdr.c
exec_domain.c
exit.c
exit.h
extable.c
fail_function.c
fork.c kernel/fork: only call untrack_pfn_clear() on VMAs duplicated for fork() 2025-05-29 11:03:14 +02:00
freezer.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms_internal.h
kallsyms_selftest.c
kallsyms_selftest.h
kallsyms.c
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.kexec
Kconfig.locks
Kconfig.preempt
kcov.c
kexec_core.c
kexec_elf.c
kexec_file.c
kexec_internal.h
kexec.c
kheaders.c
kprobes.c
ksyms_common.c
ksysfs.c
kthread.c
latencytop.c
Makefile
module_signature.c
notifier.c
nsproxy.c
padata.c padata: do not leak refcount in reorder_work 2025-05-29 11:03:19 +02:00
panic.c
params.c
pid_namespace.c
pid_sysctl.h
pid.c
profile.c
ptrace.c
range.c
reboot.c
regset.c
relay.c
resource_kunit.c
resource.c
rseq.c
scftorture.c
scs.c
seccomp.c
signal.c
smp.c
smpboot.c
smpboot.h
softirq.c
stackleak.c
stacktrace.c
static_call_inline.c
static_call.c
stop_machine.c
sys_ni.c
sys.c
sysctl-test.c
sysctl.c
task_work.c
taskstats.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user_namespace.c
user-return-notifier.c
user.c
usermode_driver.c
utsname_sysctl.c
utsname.c
vhost_task.c
vmcore_info.c
watch_queue.c
watchdog_buddy.c
watchdog_perf.c
watchdog.c watchdog: fix watchdog may detect false positive of softlockup 2025-06-27 11:11:22 +01:00
workqueue_internal.h
workqueue.c