Commit 9360dfe
sched_ext: Validate prev_cpu in scx_bpf_select_cpu_dfl()
If a BPF scheduler provides an invalid CPU (outside the nr_cpu_ids
range) as prev_cpu to scx_bpf_select_cpu_dfl() it can cause a kernel
crash.
To prevent this, validate prev_cpu in scx_bpf_select_cpu_dfl() and
trigger an scx error if an invalid CPU is specified.
Fixes: f0e1a06 ("sched_ext: Implement BPF extensible scheduler class")
Cc: [email protected] # v6.12+
Signed-off-by: Andrea Righi <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 8fef0a3 commit 9360dfe
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6422 | 6422 | | |
6423 | 6423 | | |
6424 | 6424 | | |
| 6425 | + | |
| 6426 | + | |
| 6427 | + | |
6425 | 6428 | | |
6426 | 6429 | | |
6427 | 6430 | | |
| |||
0 commit comments