Messages in this thread |  | | Date | Thu, 16 Apr 2015 20:20:37 +0200 | From | Oleg Nesterov <> | Subject | Re: [PATCH] x86/fpu: Load xsave pointer *after* initialization |
| |
On 04/16, Borislav Petkov wrote: > > Box exploded with the splat at the end because we do cache > &target->thread.fpu.state->xsave into the local variable xsave but > that pointer is NULL at that time and it gets initialized later, in > init_fpu(), see > > e7f180dcd8ab ("x86/fpu: Change xstateregs_get()/set() to use > ->xsave.i387 rather than ->fxsave")
OOPS! thanks a lot!!!
> --- a/arch/x86/kernel/i387.c > +++ b/arch/x86/kernel/i387.c > @@ -341,7 +341,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset, > unsigned int pos, unsigned int count, > void *kbuf, void __user *ubuf) > { > - struct xsave_struct *xsave = &target->thread.fpu.state->xsave; > + struct xsave_struct *xsave; > int ret; > > if (!cpu_has_xsave) > @@ -351,6 +351,8 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset, > if (ret) > return ret; > > + xsave = &target->thread.fpu.state->xsave; > +
Yes, but don't we need the same change in xstateregs_set() ?
Oleg.
|  |