From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758357AbbDWVcK (ORCPT ); Thu, 23 Apr 2015 17:32:10 -0400 Received: from mga02.intel.com ([134.134.136.20]:37553 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754209AbbDWVcF (ORCPT ); Thu, 23 Apr 2015 17:32:05 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,634,1422950400"; d="scan'208";a="718331779" Message-ID: <553964D1.300@intel.com> Date: Thu, 23 Apr 2015 14:32:01 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 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 References: <1429678319-61356-1-git-send-email-fenghua.yu@intel.com> <1429678319-61356-3-git-send-email-fenghua.yu@intel.com> <5537EC31.7080808@intel.com> <3E5A0FA7E9CA944F9D5414FEC6C712205C8CE779@ORSMSX106.amr.corp.intel.com> <5537F7AA.3010609@intel.com> <3E5A0FA7E9CA944F9D5414FEC6C712205C8CF9CF@ORSMSX106.amr.corp.intel.com> <55383E17.4010408@intel.com> <3E5A0FA7E9CA944F9D5414FEC6C712205C8D0B81@ORSMSX106.amr.corp.intel.com> In-Reply-To: <3E5A0FA7E9CA944F9D5414FEC6C712205C8D0B81@ORSMSX106.amr.corp.intel.com> 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 04/23/2015 10:09 AM, Yu, Fenghua wrote: >> > If those untouched fields of the xsave buffer are in the "init state", then >> > we've got no problem. But, are those "untouched since (1)" fields in the >> > kernel xsave buf *GUARANTEED* to be in the init state? > In fact, those untouched fields in kernel xsave buf "IS GUARANTEED" to be in > the init state. > > Please check __sanitize_i387_state() called just before copy_to_user_xstate(). > That functions GUARANTEES the untouched fields in kernel xsave buf to be in > init state. OK, that makes sense. Other than the horribly-named sanitize_i387_state(). :)