| Date | Thu, 24 Feb 2022 16:45:05 -0800 | From | Kees Cook <> | Subject | Re: [PATCH v2 08/39] x86/linkage: Add ENDBR to SYM_FUNC_START*() |
| |
On Thu, Feb 24, 2022 at 03:51:46PM +0100, Peter Zijlstra wrote: > Ensure the ASM functions have ENDBR on for IBT builds, this follows > the ARM64 example. Unlike ARM64, we'll likely end up overwriting them > with poison. > > Suggested-by: Mark Rutland <mark.rutland@arm.com> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> > --- > arch/x86/include/asm/linkage.h | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > > --- a/arch/x86/include/asm/linkage.h > +++ b/arch/x86/include/asm/linkage.h > @@ -3,6 +3,7 @@ > #define _ASM_X86_LINKAGE_H > > #include <linux/stringify.h> > +#include <asm/ibt.h> > > #undef notrace > #define notrace __attribute__((no_instrument_function)) > @@ -34,5 +35,43 @@ > > #endif /* __ASSEMBLY__ */ > > +/* > + * compressed and purgatory define this to disable EXPORT, > + * hijack this same to also not emit ENDBR. > + */ > +#ifndef __DISABLE_EXPORTS
It's certainly cleaner to avoid increasing boot stub image size, but there's no _harm_ in including them, yes?
Reviewed-by: Kees Cook <keescook@chromium.org>
-- Kees Cook
|