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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50399556C9727B4D88A595C8584AAB37B4DB9D06@GSjpTKYDCembx31.service.hitachi.net>
Date:	Thu, 21 Jan 2016 23:42:44 +0000
From:	平松雅巳 / HIRAMATU,MASAMI 
	<masami.hiramatsu.pt@...achi.com>
To:	"'Josh Poimboeuf'" <jpoimboe@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
	Michal Marek <mmarek@...e.cz>,
	Peter Zijlstra <peterz@...radead.org>,
	Andy Lutomirski <luto@...nel.org>,
	Borislav Petkov <bp@...en8.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>,
	"Pedro Alves" <palves@...hat.com>,
	Namhyung Kim <namhyung@...il.com>,
	"Bernd Petrovitsch" <bernd@...rovitsch.priv.at>,
	Chris J Arges <chris.j.arges@...onical.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jiri Slaby <jslaby@...e.cz>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
	"David S. Miller" <davem@...emloft.net>
Subject: RE: [PATCH 24/33] x86/kprobes: Get rid of
 kretprobe_trampoline_holder()

>From: Josh Poimboeuf [mailto:jpoimboe@...hat.com]
>
>The kretprobe_trampoline_holder() wrapper around kretprobe_trampoline()
>isn't used anywhere and adds some unnecessary frame pointer instructions
>which never execute.  Instead, just make kretprobe_trampoline() a proper
>ELF function.
>

Looks good to me :)

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>

Thanks!

>Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
>Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
>Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>
>Cc: "David S. Miller" <davem@...emloft.net>
>Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
>---
> arch/x86/kernel/kprobes/core.c | 57 +++++++++++++++++++++---------------------
> 1 file changed, 28 insertions(+), 29 deletions(-)
>
>diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
>index 1deffe6..5b187df 100644
>--- a/arch/x86/kernel/kprobes/core.c
>+++ b/arch/x86/kernel/kprobes/core.c
>@@ -671,38 +671,37 @@ NOKPROBE_SYMBOL(kprobe_int3_handler);
>  * When a retprobed function returns, this code saves registers and
>  * calls trampoline_handler() runs, which calls the kretprobe's handler.
>  */
>-static void __used kretprobe_trampoline_holder(void)
>-{
>-	asm volatile (
>-			".global kretprobe_trampoline\n"
>-			"kretprobe_trampoline: \n"
>+asm(
>+	".global kretprobe_trampoline\n"
>+	".type kretprobe_trampoline, @function\n"
>+	"kretprobe_trampoline:\n"
> #ifdef CONFIG_X86_64
>-			/* We don't bother saving the ss register */
>-			"	pushq %rsp\n"
>-			"	pushfq\n"
>-			SAVE_REGS_STRING
>-			"	movq %rsp, %rdi\n"
>-			"	call trampoline_handler\n"
>-			/* Replace saved sp with true return address. */
>-			"	movq %rax, 152(%rsp)\n"
>-			RESTORE_REGS_STRING
>-			"	popfq\n"
>+	/* We don't bother saving the ss register */
>+	"	pushq %rsp\n"
>+	"	pushfq\n"
>+	SAVE_REGS_STRING
>+	"	movq %rsp, %rdi\n"
>+	"	call trampoline_handler\n"
>+	/* Replace saved sp with true return address. */
>+	"	movq %rax, 152(%rsp)\n"
>+	RESTORE_REGS_STRING
>+	"	popfq\n"
> #else
>-			"	pushf\n"
>-			SAVE_REGS_STRING
>-			"	movl %esp, %eax\n"
>-			"	call trampoline_handler\n"
>-			/* Move flags to cs */
>-			"	movl 56(%esp), %edx\n"
>-			"	movl %edx, 52(%esp)\n"
>-			/* Replace saved flags with true return address. */
>-			"	movl %eax, 56(%esp)\n"
>-			RESTORE_REGS_STRING
>-			"	popf\n"
>+	"	pushf\n"
>+	SAVE_REGS_STRING
>+	"	movl %esp, %eax\n"
>+	"	call trampoline_handler\n"
>+	/* Move flags to cs */
>+	"	movl 56(%esp), %edx\n"
>+	"	movl %edx, 52(%esp)\n"
>+	/* Replace saved flags with true return address. */
>+	"	movl %eax, 56(%esp)\n"
>+	RESTORE_REGS_STRING
>+	"	popf\n"
> #endif
>-			"	ret\n");
>-}
>-NOKPROBE_SYMBOL(kretprobe_trampoline_holder);
>+	"	ret\n"
>+	".size kretprobe_trampoline, .-kretprobe_trampoline\n"
>+);
> NOKPROBE_SYMBOL(kretprobe_trampoline);
>
> /*
>--
>2.4.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ