Re: [PATCH 01/14] x86/cfi: Wreck things...
From: Josh Poimboeuf
Date: Fri Sep 27 2024 - 19:15:34 EST
On Fri, Sep 27, 2024 at 09:48:57PM +0200, Peter Zijlstra wrote:
> vmlinux.o: warning: objtool: .export_symbol+0x3c9f0: data relocation to !ENDBR: entry_untrain_ret+0x0
>
> Which states that while these functions are exported and (directly)
> callable, they cannot be called indirectly. There are two solutions:
IIRC, exported symbols are by far the most common "need" for ENDBR. But
presumably the vast majority of them aren't being indirect called.
> - exclude the .export_symbol section from validation; effectively
> saying that having linkable but not indirectly callable exports are
> fine by default, or
This is confusingly inconsistent IMO.
> - make all of those use SYM_TYPED_FUNC_START to restore the
> traditional (and expected, but less secure?) behaviour.
Why not just make SYM_FUNC_START imply "typed"? That's consistent with
what the compiler does anyway right?
Even better, require exported+indirect-called symbols to use
EXPORT_SYMBOL_TYPED, otherwise they get sealed. I suppose we'd need to
add some module-to-vmlinux ENDBR validation to make sure modules don't
get broken by this.
--
Josh