From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbbCPMIS (ORCPT ); Mon, 16 Mar 2015 08:08:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:35967 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbbCPMIN (ORCPT ); Mon, 16 Mar 2015 08:08:13 -0400 Date: Mon, 16 Mar 2015 05:07:31 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: priikone@iki.fi, stable@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, fenghua.yu@intel.com, bp@alien8.de, luto@amacapital.net, linux-kernel@vger.kernel.org, dave.hansen@intel.com, sbsiddha@gmail.com, hpa@zytor.com, quentin.casasnovas@oracle.com, mingo@kernel.org, riel@redhat.com, bp@suse.de, oleg@redhat.com Reply-To: mingo@kernel.org, quentin.casasnovas@oracle.com, riel@redhat.com, oleg@redhat.com, bp@suse.de, fenghua.yu@intel.com, linux-kernel@vger.kernel.org, luto@amacapital.net, bp@alien8.de, priikone@iki.fi, torvalds@linux-foundation.org, tglx@linutronix.de, stable@vger.kernel.org, dave.hansen@intel.com, hpa@zytor.com, sbsiddha@gmail.com In-Reply-To: <20150309171041.GB11388@redhat.com> References: <20150309171041.GB11388@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/fpu: Drop_fpu() should not assume that tsk equals current Git-Commit-ID: f4c3686386393c120710dd34df2a74183ab805fd X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f4c3686386393c120710dd34df2a74183ab805fd Gitweb: http://git.kernel.org/tip/f4c3686386393c120710dd34df2a74183ab805fd Author: Oleg Nesterov AuthorDate: Fri, 13 Mar 2015 09:53:10 +0100 Committer: Ingo Molnar CommitDate: Fri, 13 Mar 2015 12:44:29 +0100 x86/fpu: Drop_fpu() should not assume that tsk equals current drop_fpu() does clear_used_math() and usually this is correct because tsk == current. However switch_fpu_finish()->restore_fpu_checking() is called before __switch_to() updates the "current_task" variable. If it fails, we will wrongly clear the PF_USED_MATH flag of the previous task. So use clear_stopped_child_used_math() instead. Signed-off-by: Oleg Nesterov Signed-off-by: Borislav Petkov Reviewed-by: Rik van Riel Cc: Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Pekka Riikonen Cc: Quentin Casasnovas Cc: Suresh Siddha Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20150309171041.GB11388@redhat.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/fpu-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 0dbc082..72ba21a 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h @@ -370,7 +370,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(); }