This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH -tip 2/2] [BUGFIX] kprobes/x86: Fix removed int3 checking order
- From: Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Ingo Molnar <mingo at elte dot hu>, lkml<linux-kernel at vger dot kernel dot org>, systemtap<systemtap at sources dot redhat dot com>, DLE<dle-develop at lists dot sourceforge dot net>, Dave Anderson <anderson at redhat dot com>
- Date: Wed, 28 Apr 2010 08:30:04 +0530
- Subject: Re: [PATCH -tip 2/2] [BUGFIX] kprobes/x86: Fix removed int3 checking order
- References: <20100427223312.2322.60512.stgit@localhost6.localdomain6> <20100427223348.2322.9112.stgit@localhost6.localdomain6>
- Reply-to: ananth at in dot ibm dot com
On Tue, Apr 27, 2010 at 06:33:49PM -0400, Masami Hiramatsu wrote:
> Fix kprobe/x86 to check removed int3 when failing to get kprobe
> from hlist. Since we have a time window between checking int3
> exists on probed address and getting kprobe on that address,
> we can have following senario.
> -------
> CPU1 CPU2
> hit int3
> check int3 exists
> remove int3
> remove kprobe from hlist
> get kprobe from hlist
> no kprobe->OOPS!
> -------
Do you have a testcase for this issue?
> This patch moves int3 checking if there is no kprobe on that
> address for fixing this problem as follows;
> ------
> CPU1 CPU2
> hit int3
> remove int3
> remove kprobe from hlist
> get kprobe from hlist
> no kprobe->check int3 exists
> ->rollback&retry
> ------
You may also want to fix up the comment on top of kprobe_handler() about
the interrupt gate as its only true for x86_32 and not x86_64, right?
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Dave Anderson <anderson@redhat.com>
> Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>