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]
Date:	Wed, 18 Jan 2012 05:18:25 -0500
From:	Mike Frysinger <vapier@...too.org>
To:	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc:	Anton Arapov <anton@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"Linux-mm" <linux-mm@...ck.org>, Andi Kleen <andi@...stfloor.org>,
	Christoph Hellwig <hch@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Roland McGrath <roland@...k.frob.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH v9 3.2 2/9] uprobes: handle breakpoint and signal step exception.

On Wednesday 18 January 2012 04:02:32 Srikar Dronamraju wrote:
> >   Can we use existing SET_IP() instead of set_instruction_pointer() ?
> 
> Oleg had already commented about this in one his uprobes reviews.
> 
> The GET_IP/SET_IP available in include/asm-generic/ptrace.h doesnt work
> on all archs. Atleast it doesnt work on powerpc when I tried it.

so migrate the arches you need over to it.

> Also most archs define instruction_pointer(). So I thought (rather Peter
> Zijlstra suggested the name set_instruction_pointer())
> set_instruction_pointer was a better bet than SET_IP. I

asm-generic/ptrace.h already has instruction_pointer_set()

> Also I dont see any usage for SET_IP/GET_IP.

i think you mean "users" here ?  the usage should be fairly obvious.  both 
macros are used by asm-generic/ptrace.h internally, but (currently) rarely 
defined by arches themselves (by design).  the funcs that are based on these 
GET/SET helpers though do get used in many places.

simply grep arch/*/include/asm/ptrace.h

> May be we should have something like this in
> include/asm-generic/ptrace.h
> 
> #ifdef instruction_pointer
> #define GET_IP(regs)		(instruction_pointer(regs))
> #define set_instruction_pointer(regs, val) (instruction_pointer(regs) =
> (val))
> #define SET_IP(regs, val)	(set_instruction_pointer(regs,val))
> #endif
> 

what you propose here won't work on all arches which is the whole point of 
{G,S}ET_IP in the first place.  i proposed a similar idea before and was shot 
down for exactly that reason.  look at ia64 for an obvious example.

> or should we do away with GET_IP/SET_IP esp since there are no many
> users?

no, the point is to migrate to asm-generic/ptrace.h, not away from it.
-mike

Download attachment "signature.asc " of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ