>>>>> On Wed, 15 Aug 2001 11:06:34 -0700, Daniel Jacobowitz <dan@debian.org>
>>>>> said:
>> Index: linux/arch/mips/kernel/signal.c
>
>> @@ -353,12 +355,11 @@
>> owned_fp = (current == last_task_used_math);
>> err |= __put_user(owned_fp, &sc->sc_ownedfp);
>>
>> - if (current->used_math) { /* fp is active. */
>> + if (owned_fp) { /* fp is active. */
>> set_cp0_status(ST0_CU1);
>> err |= save_fp_context(sc);
>> last_task_used_math = NULL;
>> regs->cp0_status &= ~ST0_CU1;
>> - current->used_math = 0;
>> }
>>
>> return err;
dan> This is absolutely not right. It's righter than the status quo.
dan> If we don't own the FP, you don't save the FP. Then we can use
dan> FP in the signal handler, corrupting the process's original
dan> floating point context.
I also am trying to fix this problem. How about my patch?
restore_sigcontext() can be more optimized, but I think this is a
smallest patch to fix the problem.
---
Atsushi Nemoto
signal.c.patch
Description: Text document
|