sched_ext: Avoid UAF in scx_root_enable_workfn() init failure path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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().
From the CVE record · Linux
The Linux kernel's sched_ext code can dereference a freed task in scx_root_enable_workfn() when initialization fails and releasing the iterator's reference frees the task. This is a use-after-free; the input does not specify how an attacker could trigger it or whether access or user interaction is required.
Anyone running a Linux kernel with the affected sched_ext code should check their version; affected versions were not provided.