lkml.org 
[lkml]   [2015]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2015-04-16 20:41    [W:0.069 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site