linux/arch/x86_64/kernel
Andi Kleen 18bd057b14 [PATCH] i386/x86-64: Fix x87 information leak between processes
AMD K7/K8 CPUs only save/restore the FOP/FIP/FDP x87 registers in FXSAVE
when an exception is pending.  This means the value leak through
context switches and allow processes to observe some x87 instruction
state of other processes.

This was actually documented by AMD, but nobody recognized it as
being different from Intel before.

The fix first adds an optimization: instead of unconditionally
calling FNCLEX after each FXSAVE test if ES is pending and skip
it when not needed. Then do a x87 load from a kernel variable to
clear FOP/FIP/FDP.

This means other processes always will only see a constant value
defined by the kernel in their FP state.

I took some pain to make sure to chose a variable that's already
in L1 during context switch to make the overhead of this low.

Also alternative() is used to patch away the new code on CPUs
who don't need it.

Patch for both i386/x86-64.

The problem was discovered originally by Jan Beulich. Richard
Brunner provided the basic code for the workarounds, with contribution
from Jan.

This is CVE-2006-1056

Cc: richard.brunner@amd.com
Cc: jbeulich@novell.com

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-20 07:58:11 -07:00
..
acpi [ACPI] Avoid BIOS inflicted crashes by evaluating _PDC only once 2005-12-01 01:30:35 -05:00
cpufreq Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
aperture.c [PATCH] x86_64: Rename e820_mapped to e820_any_mapped 2006-04-09 11:53:17 -07:00
apic.c [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
asm-offsets.c [PATCH] x86_64: Allow nesting of int3 by default for kprobes 2006-01-16 11:27:58 -08:00
crash_dump.c [PATCH] kdump: read previous kernel's memory 2006-01-10 08:01:28 -08:00
crash.c [PATCH] kdump: x86_64 save cpu registers upon crash 2006-01-10 08:01:28 -08:00
e820.c [PATCH] x86_64: Introduce e820_all_mapped 2006-04-09 11:53:50 -07:00
early_printk.c [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
entry.S [PATCH] x86_64: When user could have changed RIP always force IRET 2006-04-09 11:53:52 -07:00
functionlist [PATCH] x86_64: Basic reorder infrastructure 2006-03-25 09:10:56 -08:00
genapic_cluster.c [PATCH] x86_64/i386: Remove preempt disable calls in lowlevel IPI 2006-01-11 19:01:57 -08:00
genapic_flat.c [PATCH] x86_64/i386: Remove preempt disable calls in lowlevel IPI 2006-01-11 19:01:57 -08:00
genapic.c [PATCH] x86-64: Use physflat on Intel for < 8 CPUs with CPU hotplug 2005-09-12 10:50:56 -07:00
head64.c [PATCH] i386/x86-64: make setup_early_printk() usage consistent 2006-01-11 19:05:04 -08:00
head.S [PATCH] x86_64: Patch to make the head.S-must-be-first-in-vmlinux order explicit 2006-03-25 09:10:55 -08:00
i387.c [PATCH] amd64: task_thread_info() 2006-01-12 09:08:51 -08:00
i8259.c [PATCH] amd64: task_thread_info() 2006-01-12 09:08:51 -08:00
init_task.c [PATCH] Change maxaligned_in_smp alignemnt macros to internodealigned_in_smp macros 2006-01-08 20:13:38 -08:00
io_apic.c [PATCH] x86_64: fix orphaned bits of timer init messages 2006-03-25 09:10:56 -08:00
ioport.c [PATCH] capable/capability.h (arch/) 2006-01-11 18:42:14 -08:00
irq.c [PATCH] more for_each_cpu() conversions 2006-03-23 07:38:17 -08:00
kprobes.c [PATCH] Switch Kprobes inline functions to __kprobes for x86_64 2006-04-19 09:13:53 -07:00
ldt.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
machine_kexec.c [PATCH] fix kexec asm 2006-03-08 14:15:04 -08:00
Makefile [PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ 2006-04-14 11:41:25 -07:00
mce_amd.c [PATCH] x86_64: Sparse warnings fix. 2006-01-11 19:05:00 -08:00
mce_intel.c [PATCH] x86_64: Some housekeeping in local APIC code 2006-01-11 19:05:03 -08:00
mce.c [PATCH] x86_64: Don't run NMI watchdog during machine checks 2006-04-09 11:53:52 -07:00
module.c [PATCH] uml: kludgy compilation fixes for x86-64 subarch modules support 2005-05-05 16:36:33 -07:00
mpparse.c [PATCH] x86_64: cleanup allocating logical cpu numbers in x86_64 2006-03-25 09:10:53 -08:00
nmi.c [PATCH] x86_64: Don't run NMI watchdog during machine checks 2006-04-09 11:53:52 -07:00
pci-dma.c [PATCH] x86_64: Fix compilation with CONFIG_PCI=n / allnoconfig 2006-04-09 11:53:51 -07:00
pci-gart.c [PATCH] x86_64: Search K8 devices on more devices. 2006-03-25 09:14:38 -08:00
pci-nommu.c [PATCH] x86_64: IOMMU printk cleanup 2006-02-04 16:43:15 -08:00
pci-swiotlb.c [PATCH] x86_64: IOMMU printk cleanup 2006-02-04 16:43:15 -08:00
pmtimer.c [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
process.c [PATCH] i386/x86-64: Fix x87 information leak between processes 2006-04-20 07:58:11 -07:00
ptrace.c [PATCH] x86_64: Remove check for canonical RIP 2006-04-11 06:38:57 -07:00
reboot.c [PATCH] i386/x86-64: Don't IPI to offline cpus on shutdown 2006-01-11 19:04:50 -08:00
relocate_kernel.S [PATCH] kexec: x86_64 kexec implementation 2005-06-25 16:24:50 -07:00
setup64.c [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
setup.c [PATCH] i386/x86-64: Fix x87 information leak between processes 2006-04-20 07:58:11 -07:00
signal.c [PATCH] swsusp: finally solve mysqld problem 2006-03-23 07:38:08 -08:00
smp.c [PATCH] x86_64: Use cpumask bitops for cpu_vm_mask 2006-03-25 09:10:56 -08:00
smpboot.c [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
suspend_asm.S [PATCH] x86_64: Set up safe page tables during resume 2005-10-10 08:36:46 -07:00
suspend.c [PATCH] x86_64: Align and pad x86_64 GDT on page boundary 2006-01-11 19:04:53 -08:00
sys_x86_64.c [PATCH] x86_64: Use common sys_time64 2005-11-14 19:55:17 -08:00
syscall.c [PATCH] x86/x86_64: mark rodata section read-only: make some datastructures const 2006-01-06 08:33:36 -08:00
time.c [PATCH] x86_64: Fix drift with HPET timer enabled 2006-04-09 11:53:53 -07:00
trampoline.S [PATCH] x86_64: Fix SMP bootup with CONFIG_KDUMP enabled 2006-01-11 19:09:58 -08:00
traps.c [PATCH] x86_64: x86_64 add crashdump trigger points 2006-04-18 10:39:19 -07:00
vmlinux.lds.S [PATCH] x86_64: Fixup read_mostly section on internode cache line size for vSMP 2006-04-09 11:53:52 -07:00
vsmp.c [PATCH] x86_64: Inclusion of ScaleMP vSMP architecture patches - vsmp_arch 2006-01-11 19:05:01 -08:00
vsyscall.c [PATCH] x86_64: Use standard __always_inline in vsyscall.c 2006-01-11 19:04:58 -08:00
x8664_ksyms.c [PATCH] No arch-specific strpbrk implementations 2006-04-11 06:18:40 -07:00