lkml.org 
[lkml]   [2020]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: x86/kprobes: kretprobe fails to triggered if kprobe at function entry is not optimized (trigger by int3 breakpoint)
    On Wed, 26 Aug 2020 17:22:39 +0900
    Masami Hiramatsu <mhiramat@kernel.org> wrote:

    > On Wed, 26 Aug 2020 07:07:09 +0000
    > "Eddy_Wu@trendmicro.com" <Eddy_Wu@trendmicro.com> wrote:
    >
    > >
    > > > -----Original Message-----
    > > > From: peterz@infradead.org <peterz@infradead.org>
    > > > Sent: Tuesday, August 25, 2020 8:09 PM
    > > > To: Masami Hiramatsu <mhiramat@kernel.org>
    > > > Cc: Eddy Wu (RD-TW) <Eddy_Wu@trendmicro.com>; linux-kernel@vger.kernel.org; x86@kernel.org; David S. Miller
    > > > <davem@davemloft.net>
    > > > Subject: Re: x86/kprobes: kretprobe fails to triggered if kprobe at function entry is not optimized (trigger by int3 breakpoint)
    > > >
    > > > Surely we can do a lockless list for this. We have llist_add() and
    > > > llist_del_first() to make a lockless LIFO/stack.
    > > >
    > >
    > > llist operations require atomic cmpxchg, for some arch doesn't have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, in_nmi() check might still needed.
    > > (HAVE_KRETPROBES && !CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG): arc, arm, csky, mips
    >
    > Good catch. In those cases, we can add in_nmi() check at arch dependent code.

    Oops, in_nmi() check is needed in pre_kretprobe_handler() which has no
    arch dependent code. Hmm, so we still need an weak function to check it...

    Thanks,

    --
    Masami Hiramatsu <mhiramat@kernel.org>

    \
     
     \ /
      Last update: 2020-08-26 11:07    [W:2.537 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site