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: <3E5A0FA7E9CA944F9D5414FEC6C712205C8D3DFC@ORSMSX106.amr.corp.intel.com>
Date:	Tue, 28 Apr 2015 22:11:14 +0000
From:	"Yu, Fenghua" <fenghua.yu@...el.com>
To:	"Hansen, Dave" <dave.hansen@...el.com>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Mallick, Asit K" <asit.k.mallick@...el.com>,
	"Williamson, Glenn P" <glenn.p.williamson@...el.com>
CC:	linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: RE: [PATCH Bugfix v2 2/4] x86/xsaves: Define and use
 user_xstate_size for xstate size in signal context

> From: Hansen, Dave
> Sent: Tuesday, April 28, 2015 3:09 PM
> To: Yu, Fenghua; H. Peter Anvin; Ingo Molnar; Thomas Gleixner; Mallick, Asit
> K; Williamson, Glenn P
> Cc: linux-kernel; x86
> Subject: Re: [PATCH Bugfix v2 2/4] x86/xsaves: Define and use
> user_xstate_size for xstate size in signal context
> 
> On 04/21/2015 09:51 PM, Fenghua Yu wrote:
> > +	/*
> > +	 * Clear xcomp_bv[63] in user's xsave area header to indicate
> > +	 * buf_fx is in standard format.
> > +	 */
> > +	xcomp_bv = xsave->xsave_hdr.xcomp_bv;
> > +	user_xsave = buf_fx;
> > +	xcomp_bv &= ~((u64)1 << 63);
> 
> I ran in to another bug.  xrestor_user() is hitting a #GP with these values:
> 
> [    6.258743] xrestore_user() tmp: ffff88003f813000
> [    6.261122] 	     XCR0: 000000000000001f
> [    6.261868] 	xstate_bv: 0000000000000003
> [    6.262613] 	 xcomp_bv: 000000000000001f
> 
> I think it is because bit 63 is clear in xcomp_bv, but there are other bits set in
> there.
> 
> I think the above needs to just do:
> 
> 	/*
> 	 * We are uncompacting the state for the user buffer.  We need
> 	 * to clear out the xcomp_bv field entirely.  The uncompacted
> 	 * form of xsave/xrstor treats this field as reserved.
> 	 */
> 	if (__put_user(0, &user_xsave->xsave_hdr.xcomp_bv))
> 		return -1;

Yes, that makes sense. I will add this in v3 patchset.

Thanks.

-Fenghua
--
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