Linux: sched_ext: Derive SCX_RQ_IN_WAKEUP from the core enqueue flags
What fixes it
- 6c401ae426e20e53a3398a8e79afd0964c0f5110LinuxCVE List
- 3fdf2ceb31e8aff77451e468bc8409e10587916aLinuxCVE List
- 6.18.55LinuxCVE List
- 6.20LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
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().
Text from CVE List
Affected versions 11
- Linuxaffected: 997967adf10ce26c3e7bd89598b3ded62b943052 before 6c401ae426e20e53a3398a8e79afd0964c0f5110CVE List
- Linuxaffected: 57ccf5ccdc56954f2a91a7f66684fd31c566bde5 before 3fdf2ceb31e8aff77451e468bc8409e10587916aCVE List
- Linuxaffected: 57ccf5ccdc56954f2a91a7f66684fd31c566bde5 before df5cdc2c832ca4e8a6d774596b9005558761a403CVE List
- Linuxaffected: ee502c056c4c9cce4c132ccb588e06ffe5b831c1CVE List
- Linuxaffected: 6.18.19 before 6.18.55CVE List
- Linuxaffected: 6.19.9 before 6.20CVE List
- Linuxaffected: 7.0CVE List
- Linuxunaffected: all versions before 7.0CVE List
- Linuxunaffected: 6.18.55 through 6.18.*CVE List
- Linuxunaffected: 7.2.9 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List