From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755748AbdBNVbI (ORCPT ); Tue, 14 Feb 2017 16:31:08 -0500 Received: from mga03.intel.com ([134.134.136.65]:12717 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755704AbdBNVbG (ORCPT ); Tue, 14 Feb 2017 16:31:06 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,162,1484035200"; d="scan'208";a="933903083" Date: Tue, 14 Feb 2017 13:26:41 -0800 From: Yu-cheng Yu To: dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, ravi.v.shankar@intel.com, torvalds@linux-foundation.org, haokexin@gmail.com, tglx@linutronix.de, Joakim.Tjernlund@infinera.com, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, fenghua.yu@intel.com, luto@kernel.org, bp@suse.de, Greg Kroah-Hartman , stable@vger.kernel.org Subject: Re: [tip:x86/urgent] x86/fpu/xstate: Fix xcomp_bv in XSAVES header Message-ID: <20170214212640.GA15885@test-lenovo> References: <1485212084-4418-1-git-send-email-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 24, 2017 at 12:46:17AM -0800, tip-bot for Yu-cheng Yu wrote: > Commit-ID: dffba9a31c7769be3231c420d4b364c92ba3f1ac > Gitweb: http://git.kernel.org/tip/dffba9a31c7769be3231c420d4b364c92ba3f1ac > Author: Yu-cheng Yu > AuthorDate: Mon, 23 Jan 2017 14:54:44 -0800 > Committer: Ingo Molnar > CommitDate: Tue, 24 Jan 2017 09:04:48 +0100 > > x86/fpu/xstate: Fix xcomp_bv in XSAVES header > > The compacted-format XSAVES area is determined at boot time and > never changed after. The field xsave.header.xcomp_bv indicates > which components are in the fixed XSAVES format. > > In fpstate_init() we did not set xcomp_bv to reflect the XSAVES > format since at the time there is no valid data. > > However, after we do copy_init_fpstate_to_fpregs() in fpu__clear(), > as in commit: > > b22cbe404a9c x86/fpu: Fix invalid FPU ptrace state after execve() > > and when __fpu_restore_sig() does fpu__restore() for a COMPAT-mode > app, a #GP occurs. This can be easily triggered by doing valgrind on > a COMPAT-mode "Hello World," as reported by Joakim Tjernlund and > others: > > https://bugzilla.kernel.org/show_bug.cgi?id=190061 > > Fix it by setting xcomp_bv correctly. > Please consider pulling this into the stable tree because my previous patch in commit: b22cbe404a9c x86/fpu: Fix invalid FPU ptrace state after execve() exposes the same issue in the stable tree. Thanks, Yu-cheng