Commit 9a415cc
committed
sched_ext: Avoid UAF in scx_root_enable_workfn() init failure path
In scx_root_enable_workfn(), put_task_struct(p) is called before scx_error()
dereferences p->comm and p->pid. If the iterator's reference is the last
drop, the task is freed synchronously and the deref becomes a UAF.
Move put_task_struct() past scx_error().
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260511214031.AF5E9C2BCB0@smtp.kernel.org/
Fixes: f0e1a06 ("sched_ext: Implement BPF extensible scheduler class")
Cc: stable@vger.kernel.org # v6.12+
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent 86ecb1c commit 9a415cc
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6973 | 6973 | | |
6974 | 6974 | | |
6975 | 6975 | | |
6976 | | - | |
6977 | 6976 | | |
6978 | 6977 | | |
6979 | 6978 | | |
| 6979 | + | |
6980 | 6980 | | |
6981 | 6981 | | |
6982 | 6982 | | |
| |||
0 commit comments