Commit 18228a7
sched_ext: Fix scx_kick_pseqs corruption on concurrent scheduler loads
commit 05e63305c85c88141500f0a2fb02afcfba9396e1 upstream.
If we load a BPF scheduler while another scheduler is already running,
alloc_kick_pseqs() would be called again, overwriting the previously
allocated arrays.
Fix by moving the alloc_kick_pseqs() call after the scx_enable_state()
check, ensuring that the arrays are only allocated when a scheduler can
actually be loaded.
Fixes: 14c1da3895a11 ("sched_ext: Allocate scx_kick_cpus_pnt_seqs lazily using kvzalloc()")
Signed-off-by: Andrea Righi <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent f1ad80f commit 18228a7
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4632 | 4632 | | |
4633 | 4633 | | |
4634 | 4634 | | |
4635 | | - | |
4636 | | - | |
4637 | | - | |
4638 | | - | |
4639 | 4635 | | |
4640 | 4636 | | |
4641 | | - | |
| 4637 | + | |
4642 | 4638 | | |
4643 | 4639 | | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
4644 | 4644 | | |
4645 | 4645 | | |
4646 | 4646 | | |
| |||
0 commit comments