[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200828234123.f033d15e4d345c03eef97e88@kernel.org>
Date: Fri, 28 Aug 2020 23:41:23 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: peterz@...radead.org
Cc: "Eddy_Wu@...ndmicro.com" <Eddy_Wu@...ndmicro.com>,
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, 28 Aug 2020 16:19:17 +0200
peterz@...radead.org wrote:
> On Fri, Aug 28, 2020 at 02:11:18PM +0000, Eddy_Wu@...ndmicro.com wrote:
> > > From: Masami Hiramatsu <mhiramat@...nel.org>
> > >
> > > OK, schedule function will be the key. I guess the senario is..
> > >
> > > 1) kretporbe replace the return address with kretprobe_trampoline on task1's kernel stack
> > > 2) the task1 forks task2 before returning to the kretprobe_trampoline
> > > 3) while copying the process with the kernel stack, task2->kretprobe_instances.first = NULL
> >
> > I think new process created by fork/clone uses a brand new kernel
> > stack? I thought only user stack are copied. Otherwise any process
> > launch should crash in the same way
>
> I was under the same impression, we create a brand new stack-frame for
> the new task, this 'fake' frame we can schedule into.
>
> It either points to ret_from_fork() for new user tasks, or
> kthread_frame_init() for kernel threads.
Ah sorry, then it's my misreading... anyway, I could reproduce the crash with
probing on schedule(). Hmm, it is better to dump the current comm with
BUG().
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists