lkml.org 
[lkml]   [2010]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task
On 02/05, Oleg Nesterov wrote:
>
> In short: why restore_i387_xstate() does init_fpu() when !used_math(),
> can't (or shouldn't) it merely do set_used_math() ?
>
> restore_i387_xstate:
>
> if (!used_math()) {
> err = init_fpu(tsk);
> if (err)
> return err;
> }
>
> note that buf != NULL. This means that used_math() was true when
> get_sigframe() was called, otherwise buf == sigcontext->fpstate
> would be NULL, right?
>
> So, the task must have the valid ->thread.xstate,

This is probably correct. But a malicious user can set sc->fpsate
and fool the kernel, so we must assume buf != NULL implies the
valid ->xstate.

Oleg.



\
 
 \ /
  Last update: 2010-02-06 13:09    [from the cache]
©2003-2011 Jasper Spaans