Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421483

Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in fault-on-single-stepping

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in fault-on-single-stepping
Date 2016-06-14 03:30 +0200
Message-ID <rJLkZ-65u-3@gated-at.bofh.it> (permalink)
References <rIRLP-45x-13@gated-at.bofh.it> <rJJjb-4NW-5@gated-at.bofh.it> <rJJsR-4Sr-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 13 Jun 2016 19:20:19 -0400
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 agree this is for stable.

> > 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.

Yeah, I think it may never be tested from beginning,
so more thant 10 years we have this issue on the kernel.
I recommend this for all the stable/long term support kernels.

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in  fault-on-single-stepping Steven Rostedt <rostedt@goodmis.org> - 2016-06-14 01:20 +0200
  Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in  fault-on-single-stepping Steven Rostedt <rostedt@goodmis.org> - 2016-06-14 01:30 +0200
    Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in  fault-on-single-stepping Masami Hiramatsu <mhiramat@kernel.org> - 2016-06-14 03:30 +0200
    Re: [PATCH tip/master] [BUGFIX] kprobes/x86: Fix to clear TF bit in  fault-on-single-stepping Ingo Molnar <mingo@kernel.org> - 2016-06-14 12:00 +0200

csiph-web