Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1380878

[PATCH] x86/entry/x32: Check top 32 bits of syscall number on the fast path

From Ben Hutchings <ben@decadent.org.uk>
Newsgroups linux.kernel
Subject [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the fast path
Date 2016-04-18 02:50 +0200
Message-ID <rp5y1-4CY-9@gated-at.bofh.it> (permalink)
References <rp5y1-4CY-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

We've always masked off the top 32 bits when x32 is enabled, but
hopefully no-one relies on that.  Now that the slow path is in C, we
check all the bits there, regardless of whether x32 is enabled.  Let's
make the fast path consistent with it.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/entry/entry_64.S | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 858b555e274b..17ba2ca9b24d 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -190,12 +190,10 @@ entry_SYSCALL_64_fastpath:
 	 */
 	TRACE_IRQS_ON
 	ENABLE_INTERRUPTS(CLBR_NONE)
-#if __SYSCALL_MASK == ~0
-	cmpq	$__NR_syscall_max, %rax
-#else
-	andl	$__SYSCALL_MASK, %eax
-	cmpl	$__NR_syscall_max, %eax
+#if __SYSCALL_MASK != ~0
+	andq	$__SYSCALL_MASK, %rax
 #endif
+	cmpq	$__NR_syscall_max, %rax
 	ja	1f				/* return -ENOSYS (already in pt_regs->ax) */
 	movq	%r10, %rcx
 

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: System call number masking Ben Hutchings <ben@decadent.org.uk> - 2016-04-18 02:50 +0200
  [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path Ben Hutchings <ben@decadent.org.uk> - 2016-04-18 02:50 +0200
    Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 07:00 +0200
      Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path Andy Lutomirski <luto@amacapital.net> - 2016-04-18 07:20 +0200
        Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 07:30 +0200
        Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 07:30 +0200
          Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path Andy Lutomirski <luto@amacapital.net> - 2016-04-18 07:40 +0200
            Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 07:50 +0200
              Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path Andy Lutomirski <luto@amacapital.net> - 2016-04-18 07:50 +0200
                Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 08:10 +0200
                Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path "H. Peter Anvin" <hpa@zytor.com> - 2016-04-18 08:20 +0200
                Re: [PATCH] x86/entry/x32: Check top 32 bits of syscall number on the  fast path Andy Lutomirski <luto@amacapital.net> - 2016-04-18 08:20 +0200

csiph-web