sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
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 |
|
|
6.12.306.14.86.15In the Linux kernel, the following vulnerability has been resolved:
sched_ext: bpf_iter_scx_dsq_new() should always initialize iterator
BPF programs may call next() and destroy() on BPF iterators even after new() returns an error value (e.g. bpf_for_each() macro ignores error returns from new()). bpf_iter_scx_dsq_new() could leave the iterator in an uninitialized state after an error return causing bpf_iter_scx_dsq_next() to dereference garbage data. Make bpf_iter_scx_dsq_new() always clear $kit->dsq so that next() and destroy() become noops.
From the CVE record · Linux
In the Linux kernel, bpf_iter_scx_dsq_new() could leave a sched_ext BPF iterator uninitialized when it returns an error. If a BPF program then calls next() on that iterator, the kernel may dereference garbage data. The input does not specify access, authentication, or user-interaction requirements.
Engineers running Linux kernels with sched_ext should check whether their kernel includes the fix; affected versions are not specified.