linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 2/4] x86/syscalls: Disallow compat entries for all types of 64-bit syscalls
Date: Wed,  3 Jul 2019 13:34:03 -0700	[thread overview]
Message-ID: <4b7565954c5a06530ac01d98cb1592538fd8ae51.1562185330.git.luto@kernel.org> (raw)
In-Reply-To: <cover.1562185330.git.luto@kernel.org>

A "compat" entry in the syscall tables means to use a different
entry on 32-bit and 64-bit builds.  This only makes sense for
syscalls that exist in the first place in 32-bit builds, so disallow
it for anything other than i386.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/entry/syscalls/syscalltbl.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/syscalls/syscalltbl.sh b/arch/x86/entry/syscalls/syscalltbl.sh
index 94fcd1951aca..53c8c1a9adf9 100644
--- a/arch/x86/entry/syscalls/syscalltbl.sh
+++ b/arch/x86/entry/syscalls/syscalltbl.sh
@@ -27,8 +27,8 @@ emit() {
     compat="$4"
     umlentry=""
 
-    if [ "$abi" = "64" -a -n "$compat" ]; then
-	echo "a compat entry for a 64-bit syscall makes no sense" >&2
+    if [ "$abi" != "I386" -a -n "$compat" ]; then
+	echo "a compat entry ($abi: $compat) for a 64-bit syscall makes no sense" >&2
 	exit 1
     fi
 
-- 
2.21.0


  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 ` Andy Lutomirski [this message]
2019-07-22  8:35   ` [tip:x86/entry] x86/syscalls: Disallow compat entries for all types of 64-bit syscalls 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 ` [PATCH 4/4] x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long Andy Lutomirski
2019-07-22  8:34   ` [tip:x86/entry] " 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=4b7565954c5a06530ac01d98cb1592538fd8ae51.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).