[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12afb52c-f555-656e-d544-c2965a616bdc@suse.com>
Date: Fri, 15 Jan 2021 06:24:10 +0100
From: Jürgen Groß <jgross@...e.com>
To: Josh Poimboeuf <jpoimboe@...hat.com>, x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
Sedat Dilek <sedat.dilek@...il.com>,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
clang-built-linux@...glegroups.com,
Miroslav Benes <mbenes@...e.cz>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Subject: Re: [PATCH 15/21] x86/xen/pvh: Convert indirect jump to retpoline
On 14.01.21 20:40, Josh Poimboeuf wrote:
> It's kernel policy to not have (unannotated) indirect jumps because of
> Spectre v2. This one's probably harmless, but better safe than sorry.
> Convert it to a retpoline.
>
> Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>
> Cc: Juergen Gross <jgross@...e.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
> ---
> arch/x86/platform/pvh/head.S | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
> index 43b4d864817e..d87cebd08d32 100644
> --- a/arch/x86/platform/pvh/head.S
> +++ b/arch/x86/platform/pvh/head.S
> @@ -16,6 +16,7 @@
> #include <asm/boot.h>
> #include <asm/processor-flags.h>
> #include <asm/msr.h>
> +#include <asm/nospec-branch.h>
> #include <xen/interface/elfnote.h>
>
> __HEAD
> @@ -105,7 +106,7 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
> /* startup_64 expects boot_params in %rsi. */
> mov $_pa(pvh_bootparams), %rsi
> mov $_pa(startup_64), %rax
> - jmp *%rax
> + JMP_NOSPEC rax
I'd rather have it annotated only.
Using ALTERNATIVE in very early boot code is just adding needless
clutter, as the retpoline variant won't ever be active.
Juergen
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists