lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150416182037.GA26537@redhat.com>
Date:	Thu, 16 Apr 2015 20:20:37 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Rik van Riel <riel@...hat.com>,
	Andy Lutomirski <luto@...capital.net>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Tavis Ormandy <taviso@...gle.com>,
	Thomas Gleixner <tglx@...utronix.de>
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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ