linux/kernel/sched
Tejun Heo 49b3378a75 sched_ext: Fix premature ops->priv publication in scx_alloc_and_add_sched()
scx_alloc_and_add_sched() publishes @sch through ops->priv before allocating
the cgroup path. If that allocation fails, the unwind path clears ops->priv
and frees @sch immediately. scx_prog_sched() callers can dereference
ops->priv from RCU context the moment it is set, so freeing without a grace
period can use-after-free a concurrent kfunc caller.

Move the publication below the cgroup path allocation so that every failure
path after publication frees @sch through kobject_put(), whose release path
defers the freeing by a grace period.

Fixes: 105dcd005b ("sched_ext: Introduce scx_prog_sched()")
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
2026-07-09 11:08:22 -10:00
..
ext sched_ext: Fix premature ops->priv publication in scx_alloc_and_add_sched() 2026-07-09 11:08:22 -10:00
autogroup.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
autogroup.h
build_policy.c sched_ext: Move sources under kernel/sched/ext/ 2026-06-22 05:32:56 -10:00
build_utility.c
clock.c sched/clock: Avoid false sharing for sched_clock_irqtime 2026-02-03 12:04:19 +01:00
completion.c
core_sched.c sched: Unify SMT active check via sched_smt_active() 2026-05-19 12:17:37 +02:00
core.c sched/mmcid: Fix OOB clear_bit when CID is MM_CID_UNSET in fixup path 2026-06-19 21:44:16 +02:00
cpuacct.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.h sched/deadline: only set free_cpus for online runqueues 2025-10-16 11:13:49 +02:00
cpufreq_schedutil.c cpufreq: Pass the policy to cpufreq_driver->adjust_perf() 2026-04-02 11:30:24 -05:00
cpufreq.c
cpupri.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpupri.h
cputime.c Merge branch 'idle-time-acc' into features 2026-06-16 16:21:46 +02:00
deadline.c Scheduler updates for v7.2: 2026-06-15 14:50:18 +05:30
debug.c sched/fair: Remove task_group->se pointer array 2026-06-02 12:26:11 +02:00
fair.c sched/fair: Fix newidle vs core-sched 2026-06-11 13:41:23 +02:00
features.h sched/rt: Have RT_PUSH_IPI be default off for non PREEMPT_RT 2026-05-19 12:17:39 +02:00
idle.c Scheduler updates for v7.2: 2026-06-15 14:50:18 +05:30
isolation.c cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock 2026-02-23 10:46:49 -10:00
loadavg.c
Makefile sched: Enable context analysis for core.c and fair.c 2026-01-05 16:43:36 +01:00
membarrier.c Locking updates for v7.2: 2026-06-15 14:21:14 +05:30
pelt.c treewide: Update email address 2026-01-11 06:09:11 -10:00
pelt.h sched/fair: Switch to task based throttle model 2025-09-03 10:03:14 +02:00
psi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rq-offsets.c sched: Make migrate_{en,dis}able() inline 2025-09-25 09:57:16 +02:00
rt.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
sched-pelt.h
sched.h sched_ext: Move sources under kernel/sched/ext/ 2026-06-22 05:32:56 -10:00
smp.h
stats.c
stats.h sched/fair: Co-locate cfs_rq and sched_entity in cfs_tg_state 2026-06-02 12:26:10 +02:00
stop_task.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
swait.c
syscalls.c Linux 7.0-rc4 2026-03-17 07:14:42 +01:00
topology.c sched/topology: Provide arch_llc_mask for cache aware scheduling 2026-05-29 12:43:15 +02:00
wait_bit.c
wait.c