This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in fault-on-single-stepping
- From: Ingo Molnar <mingo at kernel dot org>
- To: Steven Rostedt <rostedt at goodmis dot org>
- Cc: Masami Hiramatsu <mhiramat at kernel dot org>, Ingo Molnar <mingo at redhat dot com>, linux-kernel at vger dot kernel dot org, Peter Zijlstra <peterz at infradead dot org>, Ananth N Mavinakayanahalli <ananth at linux dot vnet dot ibm dot com>, Thomas Gleixner <tglx at linutronix dot de>, "H . Peter Anvin" <hpa at zytor dot com>, Andy Lutomirski <luto at kernel dot org>, systemtap at sourceware dot org, Linus Torvalds <torvalds at linux-foundation dot org>, fenghua dot yu at intel dot com
- Date: Tue, 14 Jun 2016 11:59:40 +0200
- Subject: Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in fault-on-single-stepping
- Authentication-results: sourceware.org; auth=none
- References: <20160611140648 dot 25885 dot 37482 dot stgit at devbox> <20160613191345 dot 6bdeb535 at gandalf dot local dot home> <20160613192019 dot 219a3a5f at gandalf dot local dot home>
* Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 13 Jun 2016 19:13:45 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> > > # cd /sys/kernel/debug/tracing
> > > # echo p copy_user_enhanced_fast_string+5 > kprobe_events
> > > # echo 1 > events/kprobes/enable
> > >
> > > And you'll see a kernel panic on do_debug(), since the debug
> > > trap is not handled by kprobes.
> > >
> > > To fix this problem, we just need to clear the TF bit when
> > > resetting running kprobe.
> > >
> >
> > This should definitely be marked for stable, and I bisected it all the
> > way down to this commit: f4cb1cc18f364d "x86-64, copy_user: Remove zero
> > byte check before copy user buffer."
> >
> > I reverted that commit and sure enough, this bug goes away. I'm not
> > saying the revert should be done. I'm just doing an FYI, and showing how
> > changes that appear to be a nice clean up can have subtle effects. I'm
> > not even sure how that change caused this to be a problem with kprobes.
> >
>
> Nevermind, reverting that commit only moved the location of the
> "rep movsb" that you were placing the kprobe on. When I do:
>
> echo "p copy_user_enhanced_fast_string+9" > kprobe_events
>
> I get the same result.
>
> That means we need to make that stable tag even earlier.
I added:
Cc: stable@vger.kernel.org # All the way back to ancient kernels
Thanks,
Ingo