aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/mmu.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-04-10 15:24:22 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-04-11 16:53:19 -0400
commit4eefbe792baedb474e256d35370849992fcf1c79 (patch)
tree03a95dab4a014a7f36133f9660ca180b01df62d4 /arch/x86/xen/mmu.c
parent31880c37c11e28cb81c70757e38392b42e695dc6 (diff)
x86: Use a read-only IDT alias on all CPUs
Make a copy of the IDT (as seen via the "sidt" instruction) read-only. This primarily removes the IDT from being a target for arbitrary memory write attacks, and has the added benefit of also not leaking the kernel base offset, if it has been relocated. We already did this on vendor == Intel and family == 5 because of the F0 0F bug -- regardless of if a particular CPU had the F0 0F bug or not. Since the workaround was so cheap, there simply was no reason to be very specific. This patch extends the readonly alias to all CPUs, but does not activate the #PF to #UD conversion code needed to deliver the proper exception in the F0 0F case except on Intel family 5 processors. Signed-off-by: Kees Cook <keescook@chromium.org> Link: http://lkml.kernel.org/r/20130410192422.GA17344@www.outflux.net Cc: Eric Northup <digitaleric@google.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r--arch/x86/xen/mmu.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 6afbb2ca9a0a..8bc4decb14ca 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2039,9 +2039,7 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)
2039 2039
2040 switch (idx) { 2040 switch (idx) {
2041 case FIX_BTMAP_END ... FIX_BTMAP_BEGIN: 2041 case FIX_BTMAP_END ... FIX_BTMAP_BEGIN:
2042#ifdef CONFIG_X86_F00F_BUG 2042 case FIX_RO_IDT:
2043 case FIX_F00F_IDT:
2044#endif
2045#ifdef CONFIG_X86_32 2043#ifdef CONFIG_X86_32
2046 case FIX_WP_TEST: 2044 case FIX_WP_TEST:
2047 case FIX_VDSO: 2045 case FIX_VDSO: