Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Masami Hiramatsu
Hi Andrea and Steve, On Mon, 7 Jan 2019 22:34:39 +0100 Andrea Righi wrote: > On Mon, Jan 07, 2019 at 04:28:33PM -0500, Steven Rostedt wrote: > > On Mon, 7 Jan 2019 22:19:04 +0100 > > Andrea Righi wrote: > > > > > > > If we put a kretprobe to raw_spin_lock_irqsave() it looks like > > > > > kret

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 04:28:33PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 22:19:04 +0100 > Andrea Righi wrote: > > > > > If we put a kretprobe to raw_spin_lock_irqsave() it looks like > > > > kretprobe is going to call kretprobe... > > > > > > Right, but we should be able to add som

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Steven Rostedt
On Mon, 7 Jan 2019 22:19:04 +0100 Andrea Righi wrote: > > > If we put a kretprobe to raw_spin_lock_irqsave() it looks like > > > kretprobe is going to call kretprobe... > > > > Right, but we should be able to add some recursion protection to stop > > that. I have similar protection in the ftra

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 02:59:18PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 20:52:09 +0100 > Andrea Righi wrote: > > > > Ug, kretprobe calls spinlocks in the callback? I wonder if we can > > > remove them. > > > > > > I'm guessing this is a different issue than the one that this patch >

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Steven Rostedt
On Mon, 7 Jan 2019 20:52:09 +0100 Andrea Righi wrote: > > Ug, kretprobe calls spinlocks in the callback? I wonder if we can > > remove them. > > > > I'm guessing this is a different issue than the one that this patch > > fixes. This sounds like we are calling kretprobe from kretprobe? > > > > -

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 02:27:49PM -0500, Steven Rostedt wrote: > On Mon, 7 Jan 2019 19:34:44 +0100 > Andrea Righi wrote: > > > On Mon, Jan 07, 2019 at 10:31:34PM +0900, Masami Hiramatsu wrote: > > ... > > > BTW, this is not all of issues. To remove CONFIG_KPROBE_EVENTS_ON_NOTRACE > > > I'm tryin

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Steven Rostedt
On Mon, 7 Jan 2019 19:34:44 +0100 Andrea Righi wrote: > On Mon, Jan 07, 2019 at 10:31:34PM +0900, Masami Hiramatsu wrote: > ... > > BTW, this is not all of issues. To remove CONFIG_KPROBE_EVENTS_ON_NOTRACE > > I'm trying to find out other notrace functions which can cause > > kernel crash by prob

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 10:31:34PM +0900, Masami Hiramatsu wrote: ... > BTW, this is not all of issues. To remove CONFIG_KPROBE_EVENTS_ON_NOTRACE > I'm trying to find out other notrace functions which can cause > kernel crash by probing. Mostly done on x86, so I'll post it > after this series. Not

Re: [PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Andrea Righi
On Mon, Jan 07, 2019 at 10:31:34PM +0900, Masami Hiramatsu wrote: > Hello, > > On recent talk with Andrea, I started more precise investigation on > the kernel panic with kretprobes on notrace functions, which Francis > had been reported last year ( https://lkml.org/lkml/2017/7/14/466 ). > > At f

[PATCH 0/2] kprobes: Fix kretprobe incorrect stacking order problem

2019-01-07 Thread Masami Hiramatsu
Hello, On recent talk with Andrea, I started more precise investigation on the kernel panic with kretprobes on notrace functions, which Francis had been reported last year ( https://lkml.org/lkml/2017/7/14/466 ). At first, I tried to reproduce the issue. I picked up __fdget and ftrace_ops_assist_