[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <354da72ff95aed0cea40b410f6db882bfb0877d5.1610652862.git.jpoimboe@redhat.com>
Date: Thu, 14 Jan 2021 13:40:15 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: 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>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>
Subject: [PATCH 19/21] x86/power: Convert indirect jumps to retpolines
It's kernel policy to not have (unannotated) indirect jumps because of
Spectre v2. These are probably harmless, but better safe than sorry.
Convert them to retpolines.
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Pavel Machek <pavel@....cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
---
arch/x86/power/hibernate_asm_64.S | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate_asm_64.S
index 7918b8415f13..24d971911c9d 100644
--- a/arch/x86/power/hibernate_asm_64.S
+++ b/arch/x86/power/hibernate_asm_64.S
@@ -21,6 +21,7 @@
#include <asm/asm-offsets.h>
#include <asm/processor-flags.h>
#include <asm/frame.h>
+#include <asm/nospec-branch.h>
SYM_FUNC_START(swsusp_arch_suspend)
movq $saved_context, %rax
@@ -66,7 +67,7 @@ SYM_CODE_START(restore_image)
/* jump to relocated restore code */
movq relocated_restore_code(%rip), %rcx
- jmpq *%rcx
+ JMP_NOSPEC rcx
SYM_CODE_END(restore_image)
/* code below has been relocated to a safe page */
@@ -97,7 +98,7 @@ SYM_CODE_START(core_restore_code)
.Ldone:
/* jump to the restore_registers address from the image header */
- jmpq *%r8
+ JMP_NOSPEC r8
SYM_CODE_END(core_restore_code)
/* code below belongs to the image kernel */
--
2.29.2
Powered by blists - more mailing lists