Re: [PATCH v2 07/39] x86/entry: Sprinkle ENDBR dust
From: Josh Poimboeuf
Date: Thu Feb 24 2022 - 17:37:39 EST
On Thu, Feb 24, 2022 at 03:51:45PM +0100, Peter Zijlstra wrote:
> Kernel entry points should be having ENDBR on for IBT configs.
>
> The SYSCALL entry points are found through taking their respective
> address in order to program them in the MSRs, while the exception
> entry points are found through UNWIND_HINT_IRET_REGS.
>
> The rule is that any UNWIND_HINT_IRET_REGS at sym+0 should have an
> ENDBR, see the later objtool ibt validation patch.
Could the "rule" be changed to only check global syms? It seems
unlikely a local symbol would need ENDBR.
Then you wouldn't need this annotation:
> SYM_CODE_START_LOCAL(early_idt_handler_common)
> + UNWIND_HINT_IRET_REGS offset=16
> + ANNOTATE_NOENDBR
> /*
> * The stack is the hardware frame, an error code or zero, and the
> * vector number.
--
Josh