[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-814564a0a1d2faee11ff9de43245d78cb79c85ac@git.kernel.org>
Date: Thu, 22 Jan 2015 12:12:39 -0800
From: tip-bot for Dave Hansen <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, dave.hansen@...ux.intel.com, dave@...1.net,
linux-kernel@...r.kernel.org, hpa@...or.com, tglx@...utronix.de,
luto@...capital.net
Subject: [tip:x86/urgent] x86, mpx:
Explicitly disable 32-bit MPX support on 64-bit kernels
Commit-ID: 814564a0a1d2faee11ff9de43245d78cb79c85ac
Gitweb: http://git.kernel.org/tip/814564a0a1d2faee11ff9de43245d78cb79c85ac
Author: Dave Hansen <dave.hansen@...ux.intel.com>
AuthorDate: Thu, 8 Jan 2015 14:30:20 -0800
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 22 Jan 2015 21:11:06 +0100
x86, mpx: Explicitly disable 32-bit MPX support on 64-bit kernels
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.
Signed-off-by: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Dave Hansen <dave@...1.net>
Link: http://lkml.kernel.org/r/20150108223020.9E9AA511@viggo.jf.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
arch/x86/mm/mpx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 67ebf57..c439ec4 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -349,6 +349,12 @@ static __user void *task_get_bounds_dir(struct task_struct *tsk)
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.
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists