[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200403160538.qwu237amhanr6pyi@treble>
Date: Fri, 3 Apr 2020 11:05:38 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Alexandre Chartre <alexandre.chartre@...cle.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, peterz@...radead.org,
jthierry@...hat.com, tglx@...utronix.de
Subject: Re: [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
Powered by blists - more mailing lists