android_kernel_xiaomi_sm8350/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 [PATCH] i386: Consolidate modern APIC handling 2006-04-09 11:53:51 -07:00
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 kexec: grammar fix for crash_save_this_cpu() 2006-04-01 01:39:17 +02:00
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 [PATCH] Don't pass boot parameters to argv_init[] 2006-03-31 12:18:53 -08:00
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 [PATCH] arch/i386/kernel/microcode.c: remove the obsolete microcode_ioctl 2006-03-28 09:16:06 -08:00
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 [PATCH] fix signed vs unsigned in nmi watchdog 2006-03-28 09:16:08 -08:00
numaq.c
pci-dma.c
process.c [PATCH] unexport get_wchan 2006-03-31 12:19:01 -08:00
ptrace.c
quirks.c
reboot_fixups.c [PATCH] i386: Remove printk about reboot fixups at reboot 2006-04-09 11:53:53 -07:00
reboot.c
relocate_kernel.S
scx200.c
semaphore.c
setup.c Move request_standard_resources() back to before PCI probing 2006-04-09 12:14:02 -07:00
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 [PATCH] i386: print EIP/ESP last 2006-04-11 06:18:33 -07:00
vm86.c
vmlinux.lds.S
vsyscall-int80.S
vsyscall-note.S
vsyscall-sigreturn.S [PATCH] Mark unwind info for signal trampolines in vDSOs 2006-03-31 12:18:52 -08:00
vsyscall-sysenter.S
vsyscall.lds.S
vsyscall.S