restore_user_regs and fpu

Heikki Lindholm holindho at cs.helsinki.fi
Thu Jan 5 05:36:25 EST 2006


Hello,

I haven't really confirmed this can happen, but I was wondering whether 
the following would be possible. Looking at restore_user_regs in 
ppc/kernel/signal_32.c and assuming:
* last_task_used_math == current, eg. a signal handler used fpu
* fpu state is still what the sig handler left there
If after the fpu state is restored to current->thread.fpr (copy_user) 
somebody preempts this task and uses fpu, wouldn't it cause the fpu 
state (of the sig handler) to be saved to 
last_task_used_math->thread.fpr overwriting the just restored state. 
Should the last_task_used_math nullifying, etc. be moved to the front of 
the function instead, or am I overlooking something?

-- Heikki Lindholm



More information about the Linuxppc-dev mailing list