sched_ext: Don't BUG_ON a destroyed DSQ in process_deferred_reenq_users
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: Don't BUG_ON a destroyed DSQ in process_deferred_reenq_users
scx_bpf_dsq_reenq() queues a deferred reenq (dru) that runs from run_deferred(), not ops.dispatch(). If the DSQ is destroyed before the dru runs, process_deferred_reenq_users() sees dsq->id == SCX_DSQ_INVALID and hits the BUG_ON. destroy_dsq() doesn't flush pending drus, so just skip.
tj: Read dsq->id once with READ_ONCE(). Reading it separately in the INVALID check and the BUG_ON would leave a window where destroy_dsq() can invalidate the id between the two reads and still trigger the BUG_ON.
From the CVE record · Linux
The Linux kernel’s sched_ext code can hit a BUG_ON if a dispatch queue is destroyed before a deferred re-enqueue runs. This can crash the kernel; the input does not establish how an attacker could trigger it or whether access or user interaction is required.
Anyone running Linux kernels with the affected sched_ext code should check their kernel version against the vendor advisory; affected versions were not provided.