Suresh Siddha
06c38d5e36
x86-64: fix FPU corruption with signals and preemption
...
In 64bit signal delivery path, clear_used_math() was happening before saving
the current active FPU state on to the user stack for signal handling. Between
clear_used_math() and the state store on to the user stack, potentially we
can get a page fault for the user address and can block. Infact, while testing
we were hitting the might_fault() in __clear_user() which can do a schedule().
At a later point in time, we will schedule back into this process and
resume the save state (using "xsave/fxsave" instruction) which can lead
to DNA fault. And as used_math was cleared before, we will reinit the FP state
in the DNA fault and continue. This reinit will result in loosing the
FPU state of the process.
Move clear_used_math() to a point after the FPU state has been stored
onto the user stack.
This issue is present from a long time (even before the xsave changes
and the x86 merge). But it can easily be exposed in 2.6.28.x and 2.6.29.x
series because of the __clear_user() in this path, which has an explicit
__cond_resched() leading to a context switch with CONFIG_PREEMPT_VOLUNTARY.
[ Impact: fix FPU state corruption ]
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: <stable@kernel.org> [2.6.28.x, 2.6.29.x]
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2009-04-20 14:33:00 -07:00
..
2009-04-05 02:14:15 -04:00
2009-04-20 18:09:18 +02:00
2009-04-15 08:41:16 -07:00
2008-07-10 10:13:51 -07:00
2009-03-10 16:24:23 +01:00
2009-01-03 12:03:52 -08:00
2009-04-03 10:36:57 -07:00
2008-11-28 15:24:39 +01:00
2009-03-31 13:33:50 +10:30
2009-04-01 08:59:16 -07:00
2009-04-01 08:59:16 -07:00
2009-04-03 19:25:57 +02:00
2009-03-15 07:03:15 +01:00
2009-01-03 12:04:39 -08:00
2008-10-20 08:52:39 -07:00
2008-10-20 08:52:39 -07:00
2009-02-17 17:52:44 +01:00
2008-10-13 10:33:15 +02:00
2009-03-06 16:13:15 +01:00
2008-12-03 08:56:25 +01:00
2009-01-19 00:38:58 +09:00
2009-03-30 14:04:53 +11:00
2008-12-03 08:56:25 +01:00
2009-03-23 15:02:05 +05:30
2009-03-13 02:37:18 +01:00
2009-01-09 12:46:22 -08:00
2008-08-18 08:50:19 +02:00
2009-03-27 17:28:43 +01:00
2009-02-25 08:27:46 +01:00
2009-02-24 18:08:40 +01:00
2009-03-27 17:28:43 +01:00
2009-03-14 09:42:51 +01:00
2009-03-12 11:57:46 +01:00
2009-04-09 05:43:32 +02:00
2008-06-19 14:19:03 +02:00
2009-03-14 17:23:47 -07:00
2009-03-14 15:37:14 -07:00
2009-03-17 11:52:10 -07:00
2009-02-24 18:08:38 +01:00
2008-12-12 11:08:42 +01:00
2009-02-22 18:01:18 +01:00
2008-10-20 18:27:03 +02:00
2009-03-04 20:33:16 +01:00
2009-02-10 13:13:23 +01:00
2009-03-21 16:56:10 +05:30
2009-02-23 00:08:11 +01:00
2008-12-31 18:07:42 -05:00
2009-03-21 16:57:04 +05:30
2009-03-02 12:07:48 +01:00
2009-02-24 21:52:45 +01:00
2009-02-09 12:16:05 +01:00
2009-04-08 18:06:07 +02:00
2009-03-30 18:00:26 -07:00
2009-03-30 18:00:26 -07:00
2008-10-28 17:10:27 +01:00
2009-03-21 16:55:45 +05:30
2009-02-17 17:52:44 +01:00
2009-04-02 00:49:02 +02:00
2009-03-19 14:04:19 +01:00
2009-02-23 00:08:11 +01:00
2009-01-02 17:46:24 +01:00
2009-03-10 18:13:25 -07:00
2009-03-10 18:13:25 -07:00
2009-04-02 00:49:02 +02:00
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-03-18 13:51:17 +01:00
2009-04-17 09:56:11 -07:00
2009-03-18 13:51:17 +01:00
2009-03-12 13:13:07 +01:00
2009-01-12 11:22:55 +01:00
2009-01-12 11:23:01 +01:00
2009-04-12 12:32:18 +02:00
2009-01-12 11:22:50 +01:00
2009-02-14 23:05:25 +01:00
2009-01-30 14:51:44 -08:00
2009-01-30 14:51:44 -08:00
2009-01-20 17:14:28 +01:00
2009-03-19 14:04:19 +01:00
2009-01-06 14:06:57 +01:00
2009-04-07 08:31:12 -07:00
2009-03-05 12:47:28 +01:00
2009-04-07 08:31:11 -07:00
2009-04-14 02:51:04 +02:00
2008-09-22 12:58:36 +02:00
2009-01-29 14:16:51 +01:00
2009-04-02 19:04:51 -07:00
2009-04-02 19:04:51 -07:00
2009-04-05 11:04:19 -07:00
2009-04-09 05:43:32 +02:00
2008-10-15 14:25:14 +02:00
2009-03-28 22:27:45 +01:00
2009-04-08 17:53:27 +02:00
2009-03-10 18:13:25 -07:00
2009-03-10 18:13:25 -07:00
2009-03-21 16:56:37 +05:30
2009-04-02 06:08:05 +02:00
2009-03-30 18:00:26 -07:00
2009-04-01 17:13:17 +02:00
2009-02-17 17:52:44 +01:00
2009-03-13 14:49:54 +10:30
2009-01-31 04:21:18 +01:00
2008-07-16 12:15:17 -07:00
2008-07-22 14:35:57 +02:00
Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1
2008-10-06 18:17:07 +02:00
2008-10-22 22:55:23 -07:00
2009-04-02 19:05:08 -07:00
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-04-16 16:43:20 -07:00
2008-07-22 14:35:57 +02:00
2009-03-21 16:55:24 +05:30
2009-02-13 11:35:01 -08:00
2009-02-13 11:35:01 -08:00
2008-12-08 13:49:45 +01:00
2009-03-02 12:07:48 +01:00
Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core
2008-12-23 16:27:23 +01:00
2009-03-27 17:28:43 +01:00
2009-02-17 17:52:44 +01:00
2009-04-08 14:58:10 +02:00
2009-03-05 11:27:49 +01:00
2009-03-11 09:49:01 +01:00
2009-02-11 14:00:56 -08:00
2009-03-19 14:04:19 +01:00
2009-03-30 22:05:14 +10:30
2009-03-17 14:16:02 -07:00
2009-03-17 12:58:15 -07:00
2009-03-25 21:34:28 +01:00
2008-12-28 12:21:10 -08:00
2009-01-16 14:20:22 +01:00
2009-04-20 14:33:00 -07:00