sched_ext: Derive SCX_RQ_IN_WAKEUP from the core enqueue flags
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sched_ext: Derive SCX_RQ_IN_WAKEUP from the core enqueue flags
schedule_deferred_locked() skips scheduling a deferred action while SCX_RQ_IN_WAKEUP is set and relies on the task_woken_scx() call that follows a wakeup enqueue to run it. enqueue_task_scx() sets the flag from the merged enqueue flags, which include the flags stashed for a remote activation. move_remote_task_to_local_dsq() thus sets SCX_RQ_IN_WAKEUP on the destination rq when the moved task was woken up, although no task_woken_scx() follows that activation.
An IMMED insert into a busy destination requests a local reenqueue during that enqueue. The request gets linked but not scheduled and stays pending until an unrelated wakeup or preemption on that CPU runs the deferred actions. The IMMED task sits behind the running task in the meantime. If nothing runs them before the scheduler is disabled, the request outlives the scheduler and points into its freed per-cpu area, which the next scheduler dereferences from run_deferred().
Test the core enqueue flags for the wakeup bit. Only the core's wakeup path is followed by task_woken_scx().
From the CVE record · Linux
The Linux kernel’s sched_ext scheduler can leave a deferred reenqueue request pending after a remote task activation. If the scheduler is disabled before that request runs, a subsequent scheduler can dereference freed memory. The input does not specify an attack path, authentication requirements, or user interaction.
Engineers running Linux kernels with sched_ext should check whether their kernel includes the fix; affected versions are not specified.