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 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 :-/

    --
    Josh

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