summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2026-10-27 04:08:47 -1000
committerTejun Heo <tj@kernel.org>2026-10-27 09:40:56 -1000
commita298fd5f4ee8f7e80c4dc74d9c501c22a037c6b6 (patch)
tree6b90ee83b3c6fe104685de431c5ef0a3d6585d51 /tools/lib/python
parent5173b2965834ad71d8c9035048354dce7c391125 (diff)
downloadlinux-a298fd5f4ee8f7e80c4dc74d9c501c22a037c6b6.tar.gz
linux-a298fd5f4ee8f7e80c4dc74d9c501c22a037c6b6.zip
sched_ext: Fix use-after-free of a NONE rescuee leaving its sched while running
Since an earlier patch sends a bypassed task to rescue when its host lacks SCX_CAP_BASE, a task scx_fail_parent() punted to its bypassing parent at NONE can be a rescuee. When a cgroup migration into a root-owned cgroup re-homes it while running, nothing resets it: the DEQUEUE_SAVE dequeue and put_prev_task_scx() keep a running task's slice, and __scx_disable_and_exit_task() skips a NONE task. rq->scx.rescue.curr keeps pointing at the task, now on the root. An RT task, for example, can keep the task from serving its grant until the last sub is freed. From then on scx_rescuee() returns NULL and the rescue never ends. scx_rescue_timerfn() keeps accessing the task after it is freed. Move the reset out of scx_disable_task() into scx_reset_task_fields() and call it on every path that takes a task out of its sched's control, the exit of a NONE task included. Reported-by: Sashiko <sashiko-bot@kernel.org> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions