[PATCH OLK-5.10 v1] arm64: Uninstall cpu park after cpu up

From: Sang Yan <sangyan@huawei.com> hulk inclusion category: feature bugzilla: 48159 CVE: N/A ------------------------------ One cpu in PARK state could not come up in this case: CPU 0 | CPU 1 boot_secondary(cpu 1) | --> write_park_exit(cpu 1) | | cpu uping from PARK | ... uninstall_cpu_park() | --> memset to 0 park text | | ... | Exception in memory !! wait for cpu up | Cpu 1 uping from PARK may trap into exception while cpu 0 clear cpu 1's park text memory. This uninstall_cpu_park should be after waiting for cpu up. Signed-off-by: Sang Yan <sangyan@huawei.com> --- arch/arm64/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d7b750a..fb6007d 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -300,15 +300,15 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) return ret; } -#ifdef CONFIG_ARM64_CPU_PARK - uninstall_cpu_park(cpu); -#endif /* * CPU was successfully started, wait for it to come online or * time out. */ wait_for_completion_timeout(&cpu_running, msecs_to_jiffies(5000)); +#ifdef CONFIG_ARM64_CPU_PARK + uninstall_cpu_park(cpu); +#endif if (cpu_online(cpu)) return 0; -- 2.9.5
participants (1)
-
sangyan@huawei.com