Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580661

Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area

From Dave Hansen <dave.hansen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area
Date 2017-02-14 17:50 +0100
Message-ID <taOsG-4e9-25@gated-at.bofh.it> (permalink)
References <t2mae-73t-7@gated-at.bofh.it> <t2Jqa-4Km-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 01/23/2017 01:43 AM, tip-bot for Kevin Hao wrote:
> diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
> index 1d77704..e287b90 100644
> --- a/arch/x86/kernel/fpu/xstate.c
> +++ b/arch/x86/kernel/fpu/xstate.c
> @@ -1070,6 +1070,7 @@ int copyin_to_xsaves(const void *kbuf, const void __user *ubuf,
>  	 * Add back in the features that came in from userspace:
>  	 */
>  	xsave->header.xfeatures |= xfeatures;
> +	xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xsave->header.xfeatures;

FYI, this commit bit me today.  If userspace happens to have bits clear
in the 'xfeatures' field, this will *CLEAR* bits in xcomp_bv, changing
the format of the XSAVE buffer, and breaking anything that looks at the
buffer that doesn't use the instructions.

Yu-cheng's dffba9a31c commit removed this line and fixed it up, but this
might bite someone who is bisecting.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a  XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-02-14 17:50 +0100

csiph-web