Re: [PATCH v2] x86: fix early boot crash on gcc-10

From: Borislav Petkov
Date: Wed Apr 22 2020 - 15:21:24 EST


On Wed, Apr 22, 2020 at 11:55:50AM -0700, Nick Desaulniers wrote:
> Can you add by whom? It's not clear to me which function call in
> start_secondary modifies the stack protector guard.

How's that

/*
* Prevent tail call to cpu_startup_entry() because the stack protector
* guard has been changed a couple of functions up, in
* boot_init_stack_canary() and must not be checked before tail calling
* another function.
*/
asm ("");

?

> Another question. Do we not want a stack protector at all in this
> function? I'm not super familiar with how they work; do we not want
> them at all, or simply not to check the guard?

Not to check the guard. See the beginning of
arch/x86/include/asm/stackprotector.h about how they work.

> But if we're not going to check it, I think
> __attribute__((no_stack_protector)) applied to start_secondary might
> be a more precise fix.

No such attribute in gcc yet. But yes, this came up a bit upthread, you
can go back in time for details. :)

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette