Re: [PATCH v7 05/28] x86/asm/entry: annotate THUNKs

From: Borislav Petkov
Date: Thu Feb 14 2019 - 05:35:07 EST


On Thu, Feb 14, 2019 at 11:03:14AM +0100, Jiri Slaby wrote:
> first results in objtool complaints:
> > arch/x86/entry/entry_64.o: warning: objtool: .entry.text+0x190: unsupported intra-function call
> > arch/x86/entry/entry_64.o: warning: objtool: If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE.

objtool can be fixed.

> and also the crash is misleading:
> > BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
> > #PF error: [WRITE]
> > PGD 0 P4D 0
> > Oops: 0002 [#1] PREEMPT SMP
> ...
> > RIP: 0010:__switch_to_asm+0x70/0x80

You have RIP.

But yes, there is some disadvantage of not having global symbols vs
polluting the ELF symtable with random ones.

If we're going to keep them global, then we should at least make sure
their names have proper prefix so that at least one can map them to the
kernel namespace they belong to and there is no confusion when staring
at stack traces.

Also, they should not be a lot because the places where we do all these
funky trampoline etc games where a chunk of code is outside of the
boundaries of a function, are only a couple.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.