lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1296123733.15234.53.camel@laptop>
Date:	Thu, 27 Jan 2011 11:22:13 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Christoph Hellwig <hch@...radead.org>,
	Andi Kleen <andi@...stfloor.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	SystemTap <systemtap@...rces.redhat.com>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Roland McGrath <roland@...hat.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [RFC] [PATCH 2.6.37-rc5-tip 13/20] 13: x86: x86 specific probe
 handling

On Thu, 2011-01-27 at 15:10 +0530, Srikar Dronamraju wrote:
> * Peter Zijlstra <peterz@...radead.org> [2011-01-25 14:56:22]:
> 
> > On Thu, 2010-12-16 at 15:29 +0530, Srikar Dronamraju wrote:
> > > 
> > > +void arch_uprobe_enable_sstep(struct pt_regs *regs)
> > > +{
> > > +       /*
> > > +        * Enable single-stepping by
> > > +        * - Set TF on stack
> > > +        * - Set TIF_SINGLESTEP: Guarantees that TF is set when
> > > +        *      returning to user mode.
> > > +        *  - Indicate that TF is set by us.
> > > +        */
> > > +       regs->flags |= X86_EFLAGS_TF;
> > > +       set_thread_flag(TIF_SINGLESTEP);
> > > +       set_thread_flag(TIF_FORCED_TF);
> > > +}
> > > +
> > > +void arch_uprobe_disable_sstep(struct pt_regs *regs)
> > > +{
> > > +       /* Disable single-stepping by clearing what we set */
> > > +       clear_thread_flag(TIF_SINGLESTEP);
> > > +       clear_thread_flag(TIF_FORCED_TF);
> > > +       regs->flags &= ~X86_EFLAGS_TF;
> > > +} 
> > 
> > Why not use the code from arch/x86/kernel/step.c?
> 
> user_enable_single_step and user_disable_single_step that are
> defined in arch/x86/kernel/step.c cant be called in interrupt context.

Right, because of is_setting_trap_flag()..

> Initially we were looking at enabling/disabling singlestep in
> interrupt context. Even now we disable singlestep in post notifier in
> interrupt context.
> 
> Though  arch/x86/kernel/step.c has a static function
> enable_single_step which is identical to arch_uprobe_enable_sstep;
> there is no equivalent function for arch_uprobe_disable_sstep.

Its not even close to identical, its very careful to deal with user-mode
already doing single step.

But I'll leave this to the x86 people who actually know the intricacies
of the single step cruft, I was just wondering why you weren't using (or
extending) the existing code.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ