lkml.org 
[lkml]   [2019]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/15] x86/kprobes: Fix frame pointer annotations
On Fri, 7 Jun 2019 09:36:02 -0400
Josh Poimboeuf <jpoimboe@redhat.com> wrote:

> On Fri, Jun 07, 2019 at 10:02:10PM +0900, Masami Hiramatsu wrote:
> > On Wed, 05 Jun 2019 15:07:56 +0200
> > Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > > The kprobe trampolines have a FRAME_POINTER annotation that makes no
> > > sense. It marks the frame in the middle of pt_regs, at the place of
> > > saving BP.
> >
> > commit ee213fc72fd67 introduced this code, and this is for unwinder which
> > uses frame pointer. I think current code stores the address of previous
> > (original context's) frame pointer into %rbp. So with that, if unwinder
> > tries to decode frame pointer, it can get the original %rbp value,
> > instead of &pt_regs from current %rbp.
> >
> > >
> > > Change it to mark the pt_regs frame as per the ENCODE_FRAME_POINTER
> > > from the respective entry_*.S.
> > >
> >
> > With this change, I think stack unwinder can not get the original %rbp
> > value. Peter, could you check the above commit?
>
> The unwinder knows how to decode the encoded frame pointer. So it can
> find regs by decoding the new rbp value, and it also knows that regs->bp
> is the original rbp value.
>
> Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
>

Ah, OK. My misunderstood. So this encode framepointer as same as other
interrupt entry stack.
Then, it looks good to me too.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you Josh!




> --
> Josh


--
Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2019-06-07 17:23    [W:0.115 / U:30.964 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site