Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2768134imj; Mon, 11 Feb 2019 08:10:54 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/VtTpteNDpHsZuFH4wHo4nzskuDfYx/tyj/oH8Y3aSCL0NvW3YHBrkS/7eIPYXwHGNP4K X-Received: by 2002:a17:902:1105:: with SMTP id d5mr37037846pla.47.1549901454410; Mon, 11 Feb 2019 08:10:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901454; cv=none; d=google.com; s=arc-20160816; b=MvQ1oAPt7UZmcJdX+Y1p/YA3Y2wiUqgxFkef9MZLbqCIN0cWtdkPjNbgKpgwJdbEyJ eREVaruyorhJpX/cdjGP+ZjnuKO3Y1n1P+QGN4uPmuAM3toCPIhOezFCEfLRjoMt/n8d xVXdCgQ1tVCo/Vr5oevqEPXCQoab4x8L+JHx2r9pb5QQyMn2hhuIN9Z0dNlhSw+M1eyq zRz+RCfNHoVzk1eifdZJDl7RvM/qPNTGA7UyqKaK1LC57WJwLw7qq3K21EvsSTT0A3Tr 8HKaZt+mQc/1yIkWCKx8Z4LvIq8u8NgUUSDLKA343l8XjskYRLL63yy1raBNfAOgdDxO kTWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uI91tpUgImXt8OEPuE+2HhU45NqT3WT4CVnxU+XO8kY=; b=vKg60YjEscLGaunxgKte1Uz9fNXdVdfJhbIHQC2MBFQQn8I+TTo0JLNHj6VXJLAAbE 1VknXK5nEjzGpDaV66cBTlW6JgYi1gJGnmJS589jV28aQpQAqEMyxpavItwaID8KdHcM ha75/UHwFgFziobOW3mzE068Ll49qLb8pRlfG6d1PDz6Q7TeOvJ/NXnFED71uSaBeZUZ 2qmzZF+Q7g/+mi4imiJ+RyOTAdPNs4NHula3JwgfL9NIvVcoTvmyRmERsSkrpS37ktJ8 jsF78OW28zz5CXmb2uGE/DEABY6jPyS39byR4ES9i/D8lpcYp23sb4sVvkIuuBVjdetR a/Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dTAx0EJC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si10861970pld.249.2019.02.11.08.10.38; Mon, 11 Feb 2019 08:10:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dTAx0EJC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729429AbfBKOZq (ORCPT + 99 others); Mon, 11 Feb 2019 09:25:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:59094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729405AbfBKOZg (ORCPT ); Mon, 11 Feb 2019 09:25:36 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3E53920821; Mon, 11 Feb 2019 14:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895135; bh=QNe4EtTkfjyykhJepPnsyan/cCaonyXbmGvfjeCa5vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dTAx0EJCW+lNbNbuhwelXBaXFDFxdpr0A7F56cEPJL2jL1COb6RzfGg/+x7DmfIAr sCJfTojocjCac0XXolbN55NWZBFl9o/9KkAZO5E1eli1XicM7Q0z205Cj6SXCqBrLA uzO8jK4tmHp1+uJOidxP0nQuqhF7RP6niSGhWzeg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Andrzej Siewior , Borislav Petkov , Rik van Riel , "H. Peter Anvin" , "Jason A. Donenfeld" , Andy Lutomirski , Dave Hansen , Ingo Molnar , Jann Horn , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Gleixner , kvm ML , x86-ml , Sasha Levin Subject: [PATCH 4.20 104/352] x86/fpu: Add might_fault() to user_insn() Date: Mon, 11 Feb 2019 15:15:31 +0100 Message-Id: <20190211141852.406612757@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6637401c35b2f327a35d27f44bda05e327f2f017 ] Every user of user_insn() passes an user memory pointer to this macro. Add might_fault() to user_insn() so we can spot users which are using this macro in sections where page faulting is not allowed. [ bp: Space it out to make it more visible. ] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Borislav Petkov Reviewed-by: Rik van Riel Cc: "H. Peter Anvin" Cc: "Jason A. Donenfeld" Cc: Andy Lutomirski Cc: Dave Hansen Cc: Ingo Molnar Cc: Jann Horn Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Thomas Gleixner Cc: kvm ML Cc: x86-ml Link: https://lkml.kernel.org/r/20181128222035.2996-6-bigeasy@linutronix.de Signed-off-by: Sasha Levin --- arch/x86/include/asm/fpu/internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h index 69dcdf195b61..fa2c93cb42a2 100644 --- a/arch/x86/include/asm/fpu/internal.h +++ b/arch/x86/include/asm/fpu/internal.h @@ -106,6 +106,9 @@ extern void fpstate_sanitize_xstate(struct fpu *fpu); #define user_insn(insn, output, input...) \ ({ \ int err; \ + \ + might_fault(); \ + \ asm volatile(ASM_STAC "\n" \ "1:" #insn "\n\t" \ "2: " ASM_CLAC "\n" \ -- 2.19.1