original_kernel/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
cpufreq
Makefile [PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ 2006-04-14 11:41:25 -07:00
aperture.c [PATCH] x86_64: Rename e820_mapped to e820_any_mapped 2006-04-09 11:53:17 -07:00
apic.c
asm-offsets.c
crash.c
crash_dump.c
e820.c [PATCH] x86_64: Introduce e820_all_mapped 2006-04-09 11:53:50 -07:00
early_printk.c
entry.S [PATCH] x86_64: When user could have changed RIP always force IRET 2006-04-09 11:53:52 -07:00
functionlist
genapic.c
genapic_cluster.c
genapic_flat.c
head.S
head64.c
i387.c
i8259.c
init_task.c
io_apic.c
ioport.c
irq.c
kprobes.c [PATCH] Switch Kprobes inline functions to __kprobes for x86_64 2006-04-19 09:13:53 -07:00
ldt.c
machine_kexec.c
mce.c [PATCH] x86_64: Don't run NMI watchdog during machine checks 2006-04-09 11:53:52 -07:00
mce_amd.c
mce_intel.c
module.c
mpparse.c
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
pci-nommu.c
pci-swiotlb.c
pmtimer.c
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
relocate_kernel.S
setup.c [PATCH] i386/x86-64: Fix x87 information leak between processes 2006-04-20 07:58:11 -07:00
setup64.c
signal.c
smp.c
smpboot.c
suspend.c
suspend_asm.S
sys_x86_64.c
syscall.c
time.c [PATCH] x86_64: Fix drift with HPET timer enabled 2006-04-09 11:53:53 -07:00
trampoline.S
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
vsyscall.c
x8664_ksyms.c [PATCH] No arch-specific strpbrk implementations 2006-04-11 06:18:40 -07:00