Re: [PATCH -tip v3 05/11] x86/kprobes: Add UNWIND_HINT_FUNC on kretprobe_trampoline code

From: Josh Poimboeuf
Date: Sun Mar 21 2021 - 13:51:17 EST


On Sat, Mar 20, 2021 at 09:16:16PM +0900, Masami Hiramatsu wrote:
> On Fri, 19 Mar 2021 21:22:39 +0900
> Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
>
> > From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> >
> > Add UNWIND_HINT_FUNC on kretporbe_trampoline code so that ORC
> > information is generated on the kretprobe_trampoline correctly.
> >
>
> Test bot also found a new warning for this.
>
> > >> arch/x86/kernel/kprobes/core.o: warning: objtool: kretprobe_trampoline()+0x25: call without frame pointer save/setup
>
> With CONFIG_FRAME_POINTER=y.
>
> Of course this can be fixed with additional "push %bp; mov %sp, %bp" before calling
> trampoline_handler. But actually we know that this function has a bit special
> stack frame too.
>
> Can I recover STACK_FRAME_NON_STANDARD(kretprobe_trampoline) when CONFIG_FRAME_POINTER=y ?

Yes, that's what I'd recommend.

--
Josh