kernel-ark/arch/i386/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 [PATCH] i386/x86-64: Fix ACPI disabled LAPIC handling mismerge 2006-04-18 10:39:19 -07:00
cpu [PATCH] i386/x86-64: Fix x87 information leak between processes 2006-04-20 07:58:11 -07:00
timers
.gitignore
alternative.c
apic.c
apm.c [PATCH] apm: fix Armada laptops again 2006-04-19 09:13:52 -07:00
asm-offsets.c
bootflag.c
cpuid.c [PATCH] x86 cpuid and msr notifier callback section mismatches 2006-04-19 09:13:50 -07:00
crash_dump.c
crash.c
doublefault.c
early_printk.c
efi_stub.S
efi.c
entry.S
head.S
i386_ksyms.c [PATCH] No arch-specific strpbrk implementations 2006-04-11 06:18:40 -07:00
i387.c
i8237.c
i8259.c
init_task.c
io_apic.c
ioport.c
irq.c
kprobes.c [PATCH] Switch Kprobes inline functions to __kprobes for i386 2006-04-19 09:13:52 -07:00
ldt.c
machine_kexec.c
Makefile [PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/ 2006-04-14 11:41:25 -07:00
mca.c
microcode.c
module.c
mpparse.c [PATCH] mpparse: prevent table index out-of-bounds 2006-04-11 06:18:34 -07:00
msr.c [PATCH] x86 cpuid and msr notifier callback section mismatches 2006-04-19 09:13:50 -07:00
nmi.c
numaq.c
pci-dma.c
process.c
ptrace.c
quirks.c
reboot_fixups.c
reboot.c
relocate_kernel.S
scx200.c
semaphore.c
setup.c
sigframe.h
signal.c
smp.c
smpboot.c
srat.c
summit.c
sys_i386.c
syscall_table.S [PATCH] splice: add support for sys_tee() 2006-04-11 15:51:17 +02:00
sysenter.c
time_hpet.c
time.c
topology.c
trampoline.S
traps.c
vm86.c
vmlinux.lds.S
vsyscall-int80.S
vsyscall-note.S
vsyscall-sigreturn.S
vsyscall-sysenter.S
vsyscall.lds.S
vsyscall.S