[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210323223007.GG4746@worktop.programming.kicks-ass.net>
Date: Tue, 23 Mar 2021 23:30:07 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>, X86 ML <x86@...nel.org>,
Daniel Xu <dxu@...uu.xyz>, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, kuba@...nel.org, mingo@...hat.com,
ast@...nel.org, tglx@...utronix.de, kernel-team@...com, yhs@...com,
Josh Poimboeuf <jpoimboe@...hat.com>,
linux-ia64@...r.kernel.org,
Abhishek Sagar <sagar.abhishek@...il.com>
Subject: Re: [PATCH -tip v4 10/12] x86/kprobes: Push a fake return address at
kretprobe_trampoline
On Mon, Mar 22, 2021 at 03:41:40PM +0900, Masami Hiramatsu wrote:
> ".global kretprobe_trampoline\n"
> ".type kretprobe_trampoline, @function\n"
> "kretprobe_trampoline:\n"
> #ifdef CONFIG_X86_64
So what happens if we get an NMI here? That is, after the RET but before
the push? Then our IP points into the trampoline but we've not done that
push yet.
> + /* Push fake return address to tell the unwinder it's a kretprobe */
> + " pushq $kretprobe_trampoline\n"
> UNWIND_HINT_FUNC
> + /* Save the sp-8, this will be fixed later */
> + " pushq %rsp\n"
> " pushfq\n"
> SAVE_REGS_STRING
> " movq %rsp, %rdi\n"
> " call trampoline_handler\n"
> RESTORE_REGS_STRING
> + " addq $8, %rsp\n"
> " popfq\n"
Powered by blists - more mailing lists