]> git.baikalelectronics.ru Git - kernel.git/commit
[POWERPC] Fix subtle FP state corruption bug in signal return on SMP
authorPaul Mackerras <paulus@samba.org>
Tue, 26 Jun 2007 04:49:11 +0000 (14:49 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 26 Jun 2007 04:49:11 +0000 (14:49 +1000)
commit884f807c9260595b952b9519ecd3070ead9d0bdc
tree42c190d210c90876dbc799fd58896fbdce9164ce
parent2ff6fc0f7f3cefa2fb9b61a0024901ea54c13aab
[POWERPC] Fix subtle FP state corruption bug in signal return on SMP

This fixes a bug which can cause corruption of the floating-point state
on return from a signal handler.  If we have a signal handler that has
used the floating-point registers, and it happens to context-switch to
another task while copying the interrupted floating-point state from the
user stack into the thread struct (e.g. because of a page fault, or
because it gets preempted), the context switch code will think that the
FP registers contain valid FP state that needs to be copied into the
thread_struct, and will thus overwrite the values that the signal return
code has put into the thread_struct.

This can occur because we clear the MSR bits that indicate the presence
of valid FP state after copying the state into the thread_struct.  To fix
this we just move the clearing of the MSR bits to before the copy.  A
similar potential problem also occurs with the Altivec state, and this
fixes that in the same way.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/signal_64.c