Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/retpoline: Add ANNOTATE_NOENDBR for retpolines

The retpolines are exported, so they're referenced by ksymtab sections.
But they're never indirect-branched to, so add ANNOTATE_NOENDBR.

Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls")
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/b6ec963dfd9301b6b1d74ef7758fcb0b540d6c6c.1650300597.git.jpoimboe@redhat.com

authored by

Josh Poimboeuf and committed by
Peter Zijlstra
1c0513de 613871cd

+1 -1
+1 -1
arch/x86/lib/retpoline.S
··· 31 31 .align RETPOLINE_THUNK_SIZE 32 32 SYM_INNER_LABEL(__x86_indirect_thunk_\reg, SYM_L_GLOBAL) 33 33 UNWIND_HINT_EMPTY 34 + ANNOTATE_NOENDBR 34 35 35 36 ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *%\reg), \ 36 37 __stringify(RETPOLINE \reg), X86_FEATURE_RETPOLINE, \ ··· 56 55 57 56 .align RETPOLINE_THUNK_SIZE 58 57 SYM_CODE_START(__x86_indirect_thunk_array) 59 - ANNOTATE_NOENDBR // apply_retpolines 60 58 61 59 #define GEN(reg) THUNK reg 62 60 #include <asm/GEN-for-each-reg.h>