All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] x86/asm/entry/32: Fix fallout from r9 trick removal in SYSCALL code
@ 2015-06-09 18:54 Denys Vlasenko
  2015-06-09 18:54 ` [PATCH 2/5] x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry Denys Vlasenko
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Denys Vlasenko @ 2015-06-09 18:54 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Denys Vlasenko, Linus Torvalds, Steven Rostedt, Borislav Petkov,
	H. Peter Anvin, Andy Lutomirski, Oleg Nesterov,
	Frederic Weisbecker, Alexei Starovoitov, Will Drewry, Kees Cook,
	x86, linux-kernel

I put %ebp restoration code too late. Under strace, it is not reached
and %ebp is not restored upon return to userspace.

This is the fix. Run-tested.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Alexei Starovoitov <ast@plumgrid.com>
CC: Will Drewry <wad@chromium.org>
CC: Kees Cook <keescook@chromium.org>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
 arch/x86/entry/entry_64_compat.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 2093ce6..2c44180 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -344,6 +344,7 @@ cstar_dispatch:
 	call	*ia32_sys_call_table(, %rax, 8)
 	movq	%rax, RAX(%rsp)
 1:
+	movl	RCX(%rsp), %ebp
 	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
 	testl	$_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
@@ -351,7 +352,6 @@ cstar_dispatch:
 
 sysretl_from_sys_call:
 	andl	$~TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS)
-	movl	RCX(%rsp), %ebp
 	RESTORE_RSI_RDI_RDX
 	movl	RIP(%rsp), %ecx
 	movl	EFLAGS(%rsp), %r11d
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-06-18 11:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09 18:54 [PATCH 1/5] x86/asm/entry/32: Fix fallout from r9 trick removal in SYSCALL code Denys Vlasenko
2015-06-09 18:54 ` [PATCH 2/5] x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry Denys Vlasenko
2015-06-10  7:09   ` [tip:x86/asm] x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry() tip-bot for Denys Vlasenko
2015-06-09 18:54 ` [PATCH 3/5] x86/asm/entry/32: Shorten __audit_syscall_entry args preparation Denys Vlasenko
2015-06-10  6:21   ` Ingo Molnar
2015-06-12 23:28     ` Andy Lutomirski
2015-06-10  7:10   ` [tip:x86/asm] x86/asm/entry/32: Shorten __audit_syscall_entry() " tip-bot for Denys Vlasenko
2015-06-09 18:54 ` [PATCH 4/5] x86/asm/entry/32: Replace RESTORE_RSI_RDI[_RDX] with open-coded 32-bit reads Denys Vlasenko
2015-06-09 19:01   ` Andy Lutomirski
2015-06-09 19:03     ` Denys Vlasenko
2015-06-09 19:11       ` Andy Lutomirski
2015-06-09 19:18         ` Denys Vlasenko
2015-06-09 19:27           ` Andy Lutomirski
2015-06-14  8:40   ` Ingo Molnar
2015-06-14 15:21     ` Denys Vlasenko
2015-06-15 20:20       ` Ingo Molnar
2015-06-16  0:24         ` Denys Vlasenko
2015-06-18  9:31           ` Ingo Molnar
2015-06-18 10:59             ` Denys Vlasenko
2015-06-09 18:54 ` [PATCH 5/5] x86/asm/entry/32: Simplify ptrace register shuffling Denys Vlasenko
2015-06-09 18:59   ` Andy Lutomirski
2015-06-09 19:14     ` Denys Vlasenko
2015-06-18  9:33   ` Ingo Molnar
2015-06-10  7:09 ` [tip:x86/asm] x86/asm/entry/32: Fix fallout from the R9 trick removal in the SYSCALL code tip-bot for Denys Vlasenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.