From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753787AbbCIRQj (ORCPT ); Mon, 9 Mar 2015 13:16:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58311 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbbCIRQi (ORCPT ); Mon, 9 Mar 2015 13:16:38 -0400 Date: Mon, 9 Mar 2015 18:10:41 +0100 From: Oleg Nesterov To: Dave Hansen , Borislav Petkov , Ingo Molnar Cc: Andy Lutomirski , Linus Torvalds , Pekka Riikonen , Rik van Riel , Suresh Siddha , LKML , "Yu, Fenghua" , Quentin Casasnovas Subject: [PATCH] x86/fpu: drop_fpu() should not assume that tsk == current Message-ID: <20150309171041.GB11388@redhat.com> References: <54F74F59.5070107@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F74F59.5070107@intel.com> 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 drop_fpu() does clear_used_math() and usually this is correct because tsk == current. However switch_fpu_finish()->restore_fpu_checking() is called before it updates the "current_task" variable. If it fails, we will wrongly clear the PF_USED_MATH flag of the previous task. Signed-off-by: Oleg Nesterov Cc: --- arch/x86/include/asm/fpu-internal.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 99a2067..81c86fa 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -336,7 +336,7 @@ static inline void drop_fpu(struct task_struct *tsk) preempt_disable(); tsk->thread.fpu_counter = 0; __drop_fpu(tsk); - clear_used_math(); + clear_stopped_child_used_math(tsk); preempt_enable(); } -- 1.5.5.1