RE: gcc-10: kernel stack is corrupted and fails to boot
From: David Laight
Date: Wed May 13 2020 - 12:08:04 EST
From: Arnd Bergmann
> Sent: 13 May 2020 17:00
> On Wed, May 13, 2020 at 5:31 PM Kalle Valo <kvalo@xxxxxxxxxxxxxx> wrote:
...
> I investigated a little more: This does happen with 'defconfig'
> after all, in my first try I must have missed the '-smp 2' argument
> to qemu, and it ended up working correctly with just one CPU
> but fails now.
>
> Stepping through the boot process, I see where it crashes
> in start_secondary:
>
> | /* to prevent fake stack check failure in clock setup */
> | boot_init_stack_canary();
> |
> | x86_cpuinit.setup_percpu_clockev();
> |
> | wmb();
> | cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
>
> The call to cpu_startup_entry() does not succeed, instead
> it jumps to __stack_chk_fail() from there.
Hasn't this already been fixed?
Add:
asm("");
after cpu_startup_entry() to stop it being tail-called.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)