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] [day] [month] [year] [list]
Date:	Fri, 28 Jan 2011 10:23:11 -0800 (PST)
From:	Roland McGrath <roland@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	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>,
	"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

> And reset the hardware back to block step when done, and provide the
> actual break blockstep would have.

Oh, sure, that too.  If you're that ambitious, then the place to start
first is with plain single-step working right.  When TF was already set
(either via user_enable_single_step, so TIF_SINGLESTEP is set, or just from
user mode, so it and TIF_FORCED_TF are not set, but TF is in the user
state's eflags) and you hit a uprobe, then after servicing the uprobe and
stepping over the copied original instruction and restoring the PC to where
it should be, you should let the trap turn into a SIGTRAP as normal rather
than swallowing it.

To support block-step correctly, you have to do something more clever.
If block-step was enabled (TIF_BLOCKSTEP set), then you need to figure
out which of two things is the right one to do.  If the copied original
instruction uprobes just single-stepped over is one that would trigger
block-step, then you should treat it as if plain single-step were
enabled, i.e. let that SIGTRAP go as above.  If not, then you should
swallow the signal, re-enable block-step and set TF (i.e. do the work of
user_enable_block_step) before resuming.  You have to decide which case
it is based on instruction analysis.  If it's a control-flow instruction
(including the syscall instructions), then it would trigger block-step.
IIRC a conditional branch instruction triggers it only if the branch is
taken (check the book), so you have to notice that too.


Thanks,
Roland
--
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