[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200828133843.GC1362448@hirez.programming.kicks-ass.net>
Date: Fri, 28 Aug 2020 15:38:43 +0200
From: peterz@...radead.org
To: "Eddy_Wu@...ndmicro.com" <Eddy_Wu@...ndmicro.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"naveen.n.rao@...ux.ibm.com" <naveen.n.rao@...ux.ibm.com>,
"anil.s.keshavamurthy@...el.com" <anil.s.keshavamurthy@...el.com>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"cameron@...dycamel.com" <cameron@...dycamel.com>,
"oleg@...hat.com" <oleg@...hat.com>,
"will@...nel.org" <will@...nel.org>,
"paulmck@...nel.org" <paulmck@...nel.org>
Subject: Re: [RFC][PATCH 3/7] kprobes: Remove kretprobe hash
On Fri, Aug 28, 2020 at 01:11:15PM +0000, Eddy_Wu@...ndmicro.com wrote:
> > -----Original Message-----
> > From: Peter Zijlstra <peterz@...radead.org>
> > Sent: Friday, August 28, 2020 12:13 AM
> > To: linux-kernel@...r.kernel.org; mhiramat@...nel.org
> > Cc: Eddy Wu (RD-TW) <Eddy_Wu@...ndmicro.com>; x86@...nel.org; davem@...emloft.net; rostedt@...dmis.org;
> > naveen.n.rao@...ux.ibm.com; anil.s.keshavamurthy@...el.com; linux-arch@...r.kernel.org; cameron@...dycamel.com;
> > oleg@...hat.com; will@...nel.org; paulmck@...nel.org; peterz@...radead.org
> > Subject: [RFC][PATCH 3/7] kprobes: Remove kretprobe hash
> >
> > @@ -1935,71 +1932,45 @@ unsigned long __kretprobe_trampoline_han
> > unsigned long trampoline_address,
> > void *frame_pointer)
> > {
> > // ... removed
> > // NULL here
> > + first = node = current->kretprobe_instances.first;
> > + while (node) {
> > + ri = container_of(node, struct kretprobe_instance, llist);
> >
> > - orig_ret_address = (unsigned long)ri->ret_addr;
> > - if (skipped)
> > - pr_warn("%ps must be blacklisted because of incorrect kretprobe order\n",
> > - ri->rp->kp.addr);
> > + BUG_ON(ri->fp != frame_pointer);
> >
> > - if (orig_ret_address != trampoline_address)
> > + orig_ret_address = (unsigned long)ri->ret_addr;
> > + if (orig_ret_address != trampoline_address) {
> > /*
> > * This is the real return address. Any other
> > * instances associated with this task are for
> > * other calls deeper on the call stack
> > */
> > break;
> > + }
> > +
> > + node = node->next;
> > }
> >
>
> Hi, I found a NULL pointer dereference here, where
> current->kretprobe_instances.first == NULL in these two scenario:
Hurmph, that would mean hitting the trampoline and not having a
kretprobe_instance, weird. Let me try and reproduce.
Powered by blists - more mailing lists