From: Andy Lutomirski <luto@kernel.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Borislav Petkov <bp@alien8.de>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>
Subject: [PATCH 4/4] x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long
Date: Wed, 3 Jul 2019 13:34:05 -0700 [thread overview]
Message-ID: <99b0d83ad891c67105470a1a6b63243fd63a5061.1562185330.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1562185330.git.luto@kernel.org>
Currently, it's an int. This is bizarre. Fortunately, the code
using it still works: ~__X32_SYSCALL_BIT is also int, so, if nr is
unsigned long, then C kindly sign-extends the ~__X32_SYSCALL_BIT
part, and we actually get the desired value.
This is far more subtle than it deserves to be. Syscall numbers
are, for all practical purposes, unsigned long, so make
__X32_SYSCALL_BIT be unsigned long.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
arch/x86/include/uapi/asm/unistd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/uapi/asm/unistd.h b/arch/x86/include/uapi/asm/unistd.h
index 30d7d04d72d6..196fdd02b8b1 100644
--- a/arch/x86/include/uapi/asm/unistd.h
+++ b/arch/x86/include/uapi/asm/unistd.h
@@ -3,7 +3,7 @@
#define _UAPI_ASM_X86_UNISTD_H
/* x32 syscall flag bit */
-#define __X32_SYSCALL_BIT 0x40000000
+#define __X32_SYSCALL_BIT 0x40000000UL
#ifndef __KERNEL__
# ifdef __i386__
--
2.21.0
next prev parent reply other threads:[~2019-07-03 20:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 20:34 [PATCH 0/4] x32 and compat syscall improvements Andy Lutomirski
2019-07-03 20:34 ` [PATCH 1/4] x86/syscalls: Use the compat versions of rt_sigsuspend() and rt_sigprocmask() Andy Lutomirski
2019-07-22 8:34 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-07-03 20:34 ` [PATCH 2/4] x86/syscalls: Disallow compat entries for all types of 64-bit syscalls Andy Lutomirski
2019-07-22 8:35 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-07-03 20:34 ` [PATCH 3/4] x86/syscalls: Split the x32 syscalls into their own table Andy Lutomirski
2019-07-22 8:36 ` [tip:x86/entry] " tip-bot for Andy Lutomirski
2019-07-03 20:34 ` Andy Lutomirski [this message]
2019-07-22 8:34 ` [tip:x86/entry] x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long tip-bot for Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99b0d83ad891c67105470a1a6b63243fd63a5061.1562185330.git.luto@kernel.org \
--to=luto@kernel.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).