From: tip-bot for Ben Hutchings <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
tglx@linutronix.de, ben@decadent.org.uk
Subject: [tip:x86/urgent] x86: Reject x32 executables if x32 ABI not supported
Date: Wed, 8 Oct 2014 02:21:29 -0700 [thread overview]
Message-ID: <tip-0e6d3112a4e95d55cf6dca88f298d5f4b8f29bd1@git.kernel.org> (raw)
In-Reply-To: <1410120305.6822.9.camel@decadent.org.uk>
Commit-ID: 0e6d3112a4e95d55cf6dca88f298d5f4b8f29bd1
Gitweb: http://git.kernel.org/tip/0e6d3112a4e95d55cf6dca88f298d5f4b8f29bd1
Author: Ben Hutchings <ben@decadent.org.uk>
AuthorDate: Sun, 7 Sep 2014 21:05:05 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 8 Oct 2014 11:17:42 +0200
x86: Reject x32 executables if x32 ABI not supported
It is currently possible to execve() an x32 executable on an x86_64
kernel that has only ia32 compat enabled. However all its syscalls
will fail, even _exit(). This usually causes it to segfault.
Change the ELF compat architecture check so that x32 executables are
rejected if we don't support the x32 ABI.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Link: http://lkml.kernel.org/r/1410120305.6822.9.camel@decadent.org.uk
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/include/asm/elf.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 1a055c8..ca3347a 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -160,8 +160,9 @@ do { \
#define elf_check_arch(x) \
((x)->e_machine == EM_X86_64)
-#define compat_elf_check_arch(x) \
- (elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)
+#define compat_elf_check_arch(x) \
+ (elf_check_arch_ia32(x) || \
+ (IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
#if __USER32_DS != __USER_DS
# error "The following code assumes __USER32_DS == __USER_DS"
prev parent reply other threads:[~2014-10-08 9:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-07 20:05 [PATCH RESEND] " Ben Hutchings
2014-10-04 1:40 ` Ben Hutchings
2014-10-05 21:30 ` Thomas Gleixner
2014-10-05 21:39 ` Ben Hutchings
2014-10-08 9:21 ` tip-bot for Ben Hutchings [this message]
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=tip-0e6d3112a4e95d55cf6dca88f298d5f4b8f29bd1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=ben@decadent.org.uk \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome