From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859AbYGXU1k (ORCPT ); Thu, 24 Jul 2008 16:27:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751884AbYGXU1a (ORCPT ); Thu, 24 Jul 2008 16:27:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:10781 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbYGXU13 (ORCPT ); Thu, 24 Jul 2008 16:27:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.31,248,1215414000"; d="scan'208";a="421764704" Date: Thu, 24 Jul 2008 13:27:28 -0700 From: Suresh Siddha To: Linus Torvalds Cc: "Siddha, Suresh B" , "x86@kernel.org" , "andi@firstfloor.org" , Linux Kernel Mailing List , "stable@kernel.org" , Ingo Molnar Subject: Re: [patch] x64, fpu: fix possible FPU leakage in error conditions Message-ID: <20080724202728.GL14380@linux-os.sc.intel.com> References: <20080724180429.GI14380@linux-os.sc.intel.com> <20080724185053.GJ14380@linux-os.sc.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 24, 2008 at 11:59:03AM -0700, Linus Torvalds wrote: > > On Thu, 24 Jul 2008, Suresh Siddha wrote: > > > > If we don't do init_fpu() + restore from the sane init state, process has > > to be killed, in the paranoid failing scenario of math_state_restore() > > Umm. I'm still not seeing why the right answer is not just to do "stts + > math_used = 0". > > And the specific case of math_state_restore(), that will also fix the > problem - next time around. Ok. > As far as I can tell, your patch causes serious problems in case > init_fpu() fails. Which it can do, afaik. Only the first init_fpu() can fail (memory allocation failure). But here, it is def not the first time. Anyhow, your suggestion is simple and clean. Will post the patch shortly. I have to do clear_fpu() though(stts + math_used = 0 may not be enough). thanks, suresh