[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdkbcO8RzoafON2mGiSy5P96P5+aY8GySysF2my7q+nTqw@mail.gmail.com>
Date: Wed, 22 Apr 2020 14:05:13 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Michael Matz <matz@...e.de>, Jakub Jelinek <jakub@...hat.com>,
Sergei Trofimovich <slyfox@...too.org>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10
On Wed, Apr 22, 2020 at 12:21 PM Borislav Petkov <bp@...en8.de> wrote:
>
> 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
s/functions/statements/
or
s/functions/function calls/
Sorry to be pedantic and bikeshed a comment! *ducks*
With that you can add my:
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
> * 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. :)
Filed: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94722
(Maybe a link to that might be helpful in the comment, for future
travelers? But I don't feel strongly about that either way, and
trust+defer to your judgement).
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists