linux/arch
Suresh Siddha 6ffac1e90a x64, fpu: fix possible FPU leakage in error conditions
On Thu, Jul 24, 2008 at 03:43:44PM -0700, Linus Torvalds wrote:
> So how about this patch as a starting point? This is the RightThing(tm) to
> do regardless, and if it then makes it easier to do some other cleanups,
> we should do it first. What do you think?

restore_fpu_checking() calls init_fpu() in error conditions.

While this is wrong(as our main intention is to clear the fpu state of
the thread), this was benign before commit 92d140e21f ("x86: fix taking
DNA during 64bit sigreturn").

Post commit 92d140e21f, live FPU registers may not belong to this
process at this error scenario.

In the error condition for restore_fpu_checking() (especially during the
64bit signal return), we are doing init_fpu(), which saves the live FPU
register state (possibly belonging to some other process context) into
the thread struct (through unlazy_fpu() in init_fpu()). This is wrong
and can leak the FPU data.

For the signal handler restore error condition in restore_i387(), clear
the fpu state present in the thread struct(before ultimately sending a
SIGSEGV for badframe).

For the paranoid error condition check in math_state_restore(), send a
SIGSEGV, if we fail to restore the state.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: <stable@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-26 16:37:04 +02:00
..
alpha inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
arm gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
avr32 gpiolib: allow user-selection 2008-07-25 10:53:30 -07:00
blackfin Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
cris inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
frv remove include/linux/pm_legacy.h 2008-07-24 10:47:22 -07:00
h8300 pty: remove unused UNIX98_PTY_COUNT options 2008-07-25 10:53:42 -07:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2008-07-25 17:29:03 -07:00
m32r inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
m68k PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
m68knommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2008-07-24 12:17:19 -07:00
mips remove unused #include <linux/dirent.h>'s 2008-07-25 10:53:34 -07:00
mn10300 inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
parisc flag parameters: pipe 2008-07-24 10:47:28 -07:00
powerpc powerpc: Fix boot problem due to AT_BASE_PLATFORM change 2008-07-26 09:02:43 +10:00
s390 S390 topology: don't use kthread() for arch_reinit_sched_domains() 2008-07-25 10:53:40 -07:00
sh inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-07-25 17:33:34 -07:00
sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-07-25 17:33:34 -07:00
um Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
x86 x64, fpu: fix possible FPU leakage in error conditions 2008-07-26 16:37:04 +02:00
xtensa flag parameters: pipe 2008-07-24 10:47:28 -07:00
.gitignore
Kconfig introduce HAVE_EFFICIENT_UNALIGNED_ACCESS Kconfig symbol 2008-07-25 10:53:27 -07:00