Merge tag 'sched-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Thomas Gleixner:
"A single scheduler fix to ensure that there is no stale KASAN shadow
state left on the idle task's stack when a CPU is brought up after it
was brought down before"

* tag 'sched-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sched/scs: Reset task stack state in bringup_cpu()

Changed files
+7 -4
kernel
sched
+7
kernel/cpu.c
··· 31 31 #include <linux/smpboot.h> 32 32 #include <linux/relay.h> 33 33 #include <linux/slab.h> 34 + #include <linux/scs.h> 34 35 #include <linux/percpu-rwsem.h> 35 36 #include <linux/cpuset.h> 36 37 ··· 587 586 { 588 587 struct task_struct *idle = idle_thread_get(cpu); 589 588 int ret; 589 + 590 + /* 591 + * Reset stale stack state from the last time this CPU was online. 592 + */ 593 + scs_task_reset(idle); 594 + kasan_unpoison_task_stack(idle); 590 595 591 596 /* 592 597 * Some architectures have to walk the irq descriptors to
-4
kernel/sched/core.c
··· 8619 8619 idle->flags |= PF_IDLE | PF_KTHREAD | PF_NO_SETAFFINITY; 8620 8620 kthread_set_per_cpu(idle, cpu); 8621 8621 8622 - scs_task_reset(idle); 8623 - kasan_unpoison_task_stack(idle); 8624 - 8625 8622 #ifdef CONFIG_SMP 8626 8623 /* 8627 8624 * It's possible that init_idle() gets called multiple times on a task, ··· 8774 8777 finish_arch_post_lock_switch(); 8775 8778 } 8776 8779 8777 - scs_task_reset(current); 8778 8780 /* finish_cpu(), as ran on the BP, will clean up the active_mm state */ 8779 8781 } 8780 8782