lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/7] x86/speculation: Annotate intra-function calls
On Fri, Apr 03, 2020 at 11:05:38AM -0500, Josh Poimboeuf wrote:
> On Thu, Apr 02, 2020 at 10:22:18AM +0200, Alexandre Chartre wrote:
> > .macro RETPOLINE_JMP reg:req
> > - call .Ldo_rop_\@
> > + INTRA_FUNCTION_CALL .Ldo_rop_\@
> > .Lspec_trap_\@:
> > pause
> > lfence
> > @@ -102,7 +116,7 @@
> > .Ldo_retpoline_jmp_\@:
> > RETPOLINE_JMP \reg
> > .Ldo_call_\@:
> > - call .Ldo_retpoline_jmp_\@
> > + INTRA_FUNCTION_CALL .Ldo_retpoline_jmp_\@
> > .endm
>
> There's a catch: this is part of an alternative. Which means if
> X86_FEATURE_RETPOLINE isn't set at runtime, then the retpoline won't be
> there and the ORC data will be wrong.
>
> In fact objtool should probably be made smart enough to warn about this
> situation, when an alternative changes the stack state.
>
> The only way I can think of to fix this is to have ORC alternatives :-/

Or they could be converted to use static branches instead of
alternatives.

--
Josh

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