Skip to content

Commit 0479a42

Browse files
author
Peter Zijlstra
committed
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@infradead.org> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Link: https://lkml.kernel.org/r/20230622144321.360957723%40infradead.org
1 parent 06c2afb commit 0479a42

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/include/asm/nospec-branch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@
234234
* JMP_NOSPEC and CALL_NOSPEC macros can be used instead of a simple
235235
* indirect jmp/call which may be susceptible to the Spectre variant 2
236236
* attack.
237+
*
238+
* NOTE: these do not take kCFI into account and are thus not comparable to C
239+
* indirect calls, take care when using. The target of these should be an ENDBR
240+
* instruction irrespective of kCFI.
237241
*/
238242
.macro JMP_NOSPEC reg:req
239243
#ifdef CONFIG_RETPOLINE

0 commit comments

Comments
 (0)