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: <4B0BFE21.7000102@redhat.com>
Date:	Tue, 24 Nov 2009 10:39:13 -0500
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
CC:	Ingo Molnar <mingo@...e.hu>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	lkml <linux-kernel@...r.kernel.org>,
	systemtap <systemtap@...rces.redhat.com>,
	DLE <dle-develop@...ts.sourceforge.net>,
	Jim Keniston <jkenisto@...ibm.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Christoph Hellwig <hch@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Anders Kaseorg <andersk@...lice.com>,
	Tim Abbott <tabbott@...lice.com>,
	Andi Kleen <andi@...stfloor.org>,
	Jason Baron <jbaron@...hat.com>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Subject: Re: [PATCH -tip v5 06/10] kprobes/x86: Cleanup save/restore	registers

Frederic Weisbecker wrote:
> On Mon, Nov 23, 2009 at 06:22:04PM -0500, Masami Hiramatsu wrote:
>> +#ifdef CONFIG_X86_64
>> +#define SAVE_REGS_STRING		\
>> +	/* Skip cs, ip, orig_ax. */	\
>> +	"	subq $24, %rsp\n"	\
>> +	"	pushq %rdi\n"		\
>> +	"	pushq %rsi\n"		\
>> +	"	pushq %rdx\n"		\
>> +	"	pushq %rcx\n"		\
>> +	"	pushq %rax\n"		\
>> +	"	pushq %r8\n"		\
>> +	"	pushq %r9\n"		\
>> +	"	pushq %r10\n"		\
>> +	"	pushq %r11\n"		\
>> +	"	pushq %rbx\n"		\
>> +	"	pushq %rbp\n"		\
>> +	"	pushq %r12\n"		\
>> +	"	pushq %r13\n"		\
>> +	"	pushq %r14\n"		\
>> +	"	pushq %r15\n"
>> +#define RESTORE_REGS_STRING		\
>> +	"	popq %r15\n"		\
>> +	"	popq %r14\n"		\
>> +	"	popq %r13\n"		\
>> +	"	popq %r12\n"		\
>> +	"	popq %rbp\n"		\
>> +	"	popq %rbx\n"		\
>> +	"	popq %r11\n"		\
>> +	"	popq %r10\n"		\
>> +	"	popq %r9\n"		\
>> +	"	popq %r8\n"		\
>> +	"	popq %rax\n"		\
>> +	"	popq %rcx\n"		\
>> +	"	popq %rdx\n"		\
>> +	"	popq %rsi\n"		\
>> +	"	popq %rdi\n"		\
> 
> 
> BTW, do you really need to push/pop every registers
> before/after calling a probe handler?

Yes, in both cases (kretprobe/optprpbe) it needs to
emulate kprobes behavior. kprobes can be used as
fault injection, it should pop pt_regs.

> Is it possible to only save/restore the scratch ones?

Hmm, what code did you mean?

Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com

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