From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbcBPCZb (ORCPT ); Mon, 15 Feb 2016 21:25:31 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:36513 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752198AbcBPCZa (ORCPT ); Mon, 15 Feb 2016 21:25:30 -0500 MIME-Version: 1.0 In-Reply-To: <20160215191422.GB32716@pd.tnic> References: <20160211192741.GG5565@pd.tnic> <20160212170010.GE4099@pd.tnic> <20160215191422.GB32716@pd.tnic> From: Andy Lutomirski Date: Mon, 15 Feb 2016 18:25:10 -0800 Message-ID: Subject: Re: WARNING: CPU: 0 PID: 3031 at ./arch/x86/include/asm/fpu/internal.h:530 fpu__restore+0x90/0x130() To: Borislav Petkov Cc: "linux-kernel@vger.kernel.org" , X86 ML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Feb 15, 2016 12:14 PM, "Borislav Petkov" wrote: > > --- > From: Borislav Petkov > Date: Mon, 15 Feb 2016 19:50:33 +0100 > Subject: [RFC PATCH] x86/FPU: Fix double FPU regs activation > > On the entry_INT80_32->do_syscall_32_irqs_on path on 32-bit we run with > interrupts enabled. I would change this a little bit. sys_sigreturn calls fpu__restore_sig with interrupts enabled. When restoring a 32-bit signal frame, it can happen that... > And it can happen that we get preempted right after > setting ->fpstate_active in a task's FPU. > > After we get preempted, we switch between tasks merrily and eventually > are about to switch to that task above whose ->fpstate_active we > set. We enter __switch_to() and do switch_fpu_prepare(). Our task gets > ->fpregs_active set, we find ourselves back on the call stack below and > especially in __fpu__restore_sig() which sets ->fpregs_active again. > > Leading to that whoops below. --Andy