History

Merge tag 'sched_ext-for-6.14-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext

Pull sched_ext fix from Tejun Heo: "BPF schedulers could trigger a crash by passing in an invalid CPU to the scx_bpf_select_cpu_dfl() helper. Fix it by verifying input validity" * tag 'sched_ext-for-6.14-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext: sched_ext: Validate prev_cpu in scx_bpf_select_cpu_dfl()

Linus Torvalds committed 1 year ago

Commit b7f94fc2 parents 6e8e2f8 9360dfe1 file · +3 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/sched/ext.c+3−0
@@ -6422,6 +6422,9 @@ static bool check_builtin_idle_enabled(void) · 6421 unmodified lines
6422__bpf_kfunc s32 scx_bpf_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,6422__bpf_kfunc s32 scx_bpf_select_cpu_dfl(struct task_struct *p, s32 prev_cpu,
6423 u64 wake_flags, bool *is_idle)6423 u64 wake_flags, bool *is_idle)
6424{6424{
6425 if (!ops_cpu_valid(prev_cpu, NULL))
6426 goto prev_cpu;
6427
6425 if (!check_builtin_idle_enabled())6428 if (!check_builtin_idle_enabled())
6426 goto prev_cpu;6429 goto prev_cpu;
6427 6430