From: Peter Zijlstra <peterz@infradead.org>
To: x86@kernel.org, alyssa.milburn@linux.intel.com
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
samitolvanen@google.com, keescook@chromium.org,
jpoimboe@kernel.org, joao@overdrivepizza.com, brgerst@gmail.com
Subject: [PATCH v2 1/6] x86/cfi: Extend {JMP,CAKK}_NOSPEC comment
Date: Thu, 22 Jun 2023 16:42:19 +0200 [thread overview]
Message-ID: <20230622144321.360957723@infradead.org> (raw)
In-Reply-To: <20230622144218.860926475@infradead.org>
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@infradead.org>
---
arch/x86/include/asm/nospec-branch.h | 4 ++++
1 file changed, 4 insertions(+)
--- 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
next prev parent reply other threads:[~2023-06-22 14:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 14:42 [PATCH v2 0/6] x86/cfi: Fix FineIBT Peter Zijlstra
2023-06-22 14:42 ` Peter Zijlstra [this message]
2023-06-22 14:42 ` [PATCH v2 2/6] x86/alternative: Rename apply_ibt_endbr() Peter Zijlstra
2023-06-22 14:42 ` [PATCH v2 3/6] x86/cfi: Extend ENDBR sealing to kCFI Peter Zijlstra
2023-06-22 14:42 ` [PATCH v2 4/6] x86/32: Remove schedule_tail_wrapper() Peter Zijlstra
2023-06-22 14:42 ` [PATCH v2 5/6] x86: Rewrite ret_from_fork() in C Peter Zijlstra
2023-06-22 14:42 ` [PATCH v2 6/6] x86/fineibt: Poison ENDBR at +0 Peter Zijlstra
2023-06-22 16:14 ` [PATCH v2 0/6] x86/cfi: Fix FineIBT Kees Cook
2023-06-23 0:20 ` Sami Tolvanen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230622144321.360957723@infradead.org \
--to=peterz@infradead.org \
--cc=alyssa.milburn@linux.intel.com \
--cc=brgerst@gmail.com \
--cc=joao@overdrivepizza.com \
--cc=jpoimboe@kernel.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samitolvanen@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®