[<prev] [next>] [day] [month] [year] [list]
Message-ID: <168897683854.404.12338449674612649088.tip-bot2@tip-bot2>
Date: Mon, 10 Jul 2023 08:13:58 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>,
Kees Cook <keescook@...omium.org>,
Sami Tolvanen <samitolvanen@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/urgent] x86/cfi: Extend {JMP,CAKK}_NOSPEC comment
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 0479a42d4c15bd554f54d89d12bf68218e3e70da
Gitweb: https://git.kernel.org/tip/0479a42d4c15bd554f54d89d12bf68218e3e70da
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Thu, 22 Jun 2023 16:27:13 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 10 Jul 2023 09:52:23 +02:00
x86/cfi: Extend {JMP,CAKK}_NOSPEC comment
With the introduction of kCFI these helpers are no longer equivalent
to C indirect calls and should be used with care.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Kees Cook <keescook@...omium.org>
Reviewed-by: Sami Tolvanen <samitolvanen@...gle.com>
Link: https://lkml.kernel.org/r/20230622144321.360957723%40infradead.org
---
arch/x86/include/asm/nospec-branch.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
index 55388c9..1a65cf4 100644
--- a/arch/x86/include/asm/nospec-branch.h
+++ b/arch/x86/include/asm/nospec-branch.h
@@ -234,6 +234,10 @@
* JMP_NOSPEC and CALL_NOSPEC macros can be used instead of a simple
* indirect jmp/call which may be susceptible to the Spectre variant 2
* attack.
+ *
+ * NOTE: these do not take kCFI into account and are thus not comparable to C
+ * indirect calls, take care when using. The target of these should be an ENDBR
+ * instruction irrespective of kCFI.
*/
.macro JMP_NOSPEC reg:req
#ifdef CONFIG_RETPOLINE
Powered by blists - more mailing lists