From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932072AbdBNQsC (ORCPT ); Tue, 14 Feb 2017 11:48:02 -0500 Received: from mga06.intel.com ([134.134.136.31]:21946 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbdBNQrz (ORCPT ); Tue, 14 Feb 2017 11:47:55 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,162,1484035200"; d="scan'208";a="933801395" Subject: Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area To: brgerst@gmail.com, bp@alien8.de, tglx@linutronix.de, quentin.casasnovas@oracle.com, oleg@redhat.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, mingo@kernel.org, haokexin@gmail.com, hpa@zytor.com, fenghua.yu@intel.com, jpoimboe@redhat.com, peterz@infradead.org, riel@redhat.com, yu-cheng.yu@intel.com, luto@kernel.org References: <1485075023-30161-1-git-send-email-haokexin@gmail.com> From: Dave Hansen Message-ID: Date: Tue, 14 Feb 2017 08:47:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.