summaryrefslogtreecommitdiff
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-04-25 03:31:35 +0300
committerTejun Heo <tj@kernel.org>2026-04-25 03:31:35 +0300
commit80afd4c84bc8f5e80145ce35279f5ce53f6043db (patch)
tree592c4cbb256355b680e5d5d4b30dc1c8a5f473a1 /include/linux/string.h
parent21a5a97ba47842ef0c52d6c89e501dce27806550 (diff)
downloadlinux-80afd4c84bc8f5e80145ce35279f5ce53f6043db.tar.xz
sched_ext: Read scx_root under scx_cgroup_ops_rwsem in cgroup setters
scx_group_set_{weight,idle,bandwidth}() cache scx_root before acquiring scx_cgroup_ops_rwsem, so the pointer can be stale by the time the op runs. If the loaded scheduler is disabled and freed (via RCU work) and another is enabled between the naked load and the rwsem acquire, the reader sees scx_cgroup_enabled=true (the new scheduler's) but dereferences the freed one - UAF on SCX_HAS_OP(sch, ...) / SCX_CALL_OP(sch, ...). scx_cgroup_enabled is toggled only under scx_cgroup_ops_rwsem write (scx_cgroup_{init,exit}), so reading scx_root inside the rwsem read section correlates @sch with the enabled snapshot. Fixes: a5bd6ba30b33 ("sched_ext: Use cgroup_lock/unlock() to synchronize against cgroup operations") Cc: stable@vger.kernel.org # v6.18+ Reported-by: Chris Mason <clm@meta.com> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'include/linux/string.h')
0 files changed, 0 insertions, 0 deletions