From: Dave Hansen <dave@sr71.net>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, x86@kernel.org, luto@amacapital.net,
Dave Hansen <dave@sr71.net>,
dave.hansen@linux.intel.com
Subject: [PATCH 1/3] x86, mpx: explicitly disable 32-bit MPX support on 64-bit kernels
Date: Thu, 08 Jan 2015 14:30:20 -0800 [thread overview]
Message-ID: <20150108223020.9E9AA511@viggo.jf.intel.com> (raw)
In-Reply-To: <20150108223018.A57DEE63@viggo.jf.intel.com>
From: Dave Hansen <dave.hansen@linux.intel.com>
We had originally planned on submitting MPX support in one patch
set. We eventually broke it up in to two pieces for easier
review. One of the features that didn't make the first round
was supporting 32-bit binaries on 64-bit kernels.
Once we split the set up, we never added code to restrict 32-bit
binaries from _using_ MPX on 64-bit kernels.
The 32-bit bounds tables are a different format than the 64-bit
ones. Without this patch, the kernel will try to read a 32-bit
binary's tables as if they were the 64-bit version. They will
likely be noticed as being invalid rather quickly and the app
will get killed, but that's kinda mean.
This patch adds an explicit check, and will make a 64-bit kernel
essentially behave as if it has no MPX support when called from
a 32-bit binary.
I intend to remove this check once the mixed binary support is
added. Those patches are posted if anyone is interested:
https://lkml.org/lkml/2014/12/12/632
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
---
b/arch/x86/mm/mpx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff -puN arch/x86/mm/mpx.c~x86-mpx-explicitly-disable-32-bit-on-64-bit-for-3_19 arch/x86/mm/mpx.c
--- a/arch/x86/mm/mpx.c~x86-mpx-explicitly-disable-32-bit-on-64-bit-for-3_19 2015-01-08 12:48:09.123864625 -0800
+++ b/arch/x86/mm/mpx.c 2015-01-08 12:48:09.126864760 -0800
@@ -349,6 +349,12 @@ static __user void *task_get_bounds_dir(
return MPX_INVALID_BOUNDS_DIR;
/*
+ * 32-bit binaries on 64-bit kernels are currently
+ * unsupported.
+ */
+ if (IS_ENABLED(CONFIG_X86_64) && test_thread_flag(TIF_IA32))
+ return MPX_INVALID_BOUNDS_DIR;
+ /*
* The bounds directory pointer is stored in a register
* only accessible if we first do an xsave.
*/
_
next prev parent reply other threads:[~2015-01-08 22:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 22:30 [PATCH 0/3] x86, mpx: Fixes for 3.19 Dave Hansen
2015-01-08 22:30 ` Dave Hansen [this message]
2015-01-22 20:12 ` [tip:x86/urgent] x86, mpx: Explicitly disable 32-bit MPX support on 64-bit kernels tip-bot for Dave Hansen
2015-01-08 22:30 ` [PATCH 2/3] x86 mpx: fix potential performance issue on unmaps Dave Hansen
2015-01-22 20:13 ` [tip:x86/urgent] x86, mpx: Fix " tip-bot for Dave Hansen
2015-01-08 22:30 ` [PATCH 3/3] x86 mpx: strictly enforce empty prctl() args Dave Hansen
2015-01-22 20:13 ` [tip:x86/urgent] x86, mpx: Strictly " tip-bot for Dave Hansen
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=20150108223020.9E9AA511@viggo.jf.intel.com \
--to=dave@sr71.net \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=tglx@linutronix.de \
--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