From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932539AbbCIQ0R (ORCPT ); Mon, 9 Mar 2015 12:26:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53257 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932339AbbCIQ0N (ORCPT ); Mon, 9 Mar 2015 12:26:13 -0400 Date: Mon, 9 Mar 2015 17:24:04 +0100 From: Oleg Nesterov To: Borislav Petkov Cc: Dave Hansen , Ingo Molnar , Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: Re: [PATCH 1/1] x86/fpu: x86/fpu: avoid math_state_restore() without used_math() in __restore_xstate_sig() Message-ID: <20150309162404.GA7833@redhat.com> References: <54F74F59.5070107@intel.com> <20150305195127.GA12657@redhat.com> <20150307153824.GA25954@redhat.com> <20150307153844.GB25954@redhat.com> <20150309140712.GB12732@pd.tnic> <20150309143436.GA3526@redhat.com> <20150309151837.GC12732@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150309151837.GC12732@pd.tnic> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09, Borislav Petkov wrote: > > On Mon, Mar 09, 2015 at 03:34:36PM +0100, Oleg Nesterov wrote: > > The patch only fixes the problem with irqs disabled, I tested this. > > > > The problem with fpu_init/XRSTORS is another thing... > > Yet another thing?! Oh boy. Well, this is the same thinhg reported by Dave ;) > So first Dave reported the #GP, which got fixed by Quentin's patch. It is not fixed by Quentin's patch. This patch "fixes" the problem in a sense that the kernel won't crash after restore_fpu_checking() triggers #GP. Before this patch do_general_protection()->fixup_exception() does not work in this case and the kernel panics. But restore_fpu_checking() should not trigger #GP (and fail). And just in case... tip/x86/fpu still won't work even with the patch from Quentin. Again, the kernel won't crash, but /sbin/init will be killed by SIGSEGV I guess. Because restore_fpu_checking() will fail. I'll change flush_thread() to rely on init_xstate_buf, I was going to do this anyway. But this too doesn't fix the problem: fpu_finit() is buggy on Dave's machine. Oleg.