lkml.org 
[lkml]   [2020]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86: fix early boot crash on gcc-10
On Fri, Apr 17, 2020 at 11:22:25AM -0700, Nick Desaulniers wrote:
> > Sorry, I don't quite follow. The idea is that an empty asm statement
> > in foo() should prevent foo() from being inlined into bar()?
>
> s/inlined/tail called/

Yeah. The thing is, the caller changes the stack protector guard base
value, so at the start of the function it saves a different value then
it compares at the end. But, the function that it calls at the end
actually doesn't return, so this isn't a problem.
If it is tail called though, the stack protector guard checking is done
before the tail call and it crashes.
If the called function is marked with noreturn attribute or _Noreturn,
at least GCC will also not tail call it and all is fine, but not sure
what LLVM does in that case.

Jakub

\
 
 \ /
  Last update: 2020-04-17 21:06    [W:1.103 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site