Received: by 10.223.176.5 with SMTP id f5csp2853936wra; Mon, 5 Feb 2018 11:00:34 -0800 (PST) X-Google-Smtp-Source: AH8x227RbYJEbS8oiRZyeNWwer08SczU2HH3I8uYvI2MPYo7Rjwhb2S4Lp7wwaE2ZgBhBiW547cM X-Received: by 10.98.73.157 with SMTP id r29mr7587088pfi.218.1517857234086; Mon, 05 Feb 2018 11:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517857234; cv=none; d=google.com; s=arc-20160816; b=bOaji9WIUWXvPmwWvQoqDQ4CWBSMxRi7XK1DS9VbsbLRV4Jd80uayJLu5He1H26HA6 dFNb/Owesoo8/liGsoz9fE8pj8JRlIXQyAsiFjsdkopFyEk7DUs4Kus6FrhaLsNC9fmu GLNq/AHadMjvdkW983YCHxaQMwiaQoJdYtQvdXQj57y/8HlgDSTT1A51pr9uwSYQITXp DBv+wBOobt7GXmUkQUIcY9Op8iFWVIB8UpDAbr5xzlCnJji3tCC6I8QU61cptb6kQPJ1 Jjwoc/oDgx1tJV+LLs8aTr4COLOMINgl3wEJFqOp1dHVHXMEME47ChFlsfPfuTuICMS/ SuNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=gv3YsLBde5kO5fcOgG3nph0DxcXgKnXEQL/6Q7ntYTk=; b=bVSjOel/EvlwtcesMV3cL1A1DZcp+0d5rPl7gfgJ4EZoKAFfoLL/BiJWJBViQZ0MLY qExLjjxQ0x9eF46PgSItufoDrOXVLVC4l/gDHOvBQYekC9lVU8atB5xuoHRcK68RJ7TQ SSPFAKjfJfGeIt7ZxnDADn7ljwUCZzlsGkW/RFhdSBtm2GJYCtqC7PQtJzFJgqHGiyv6 s+rMPxW4Ahu9/oo0NiX0rAWd/ERDhv2sJYadana7qq/501GmRRBpI2IiL1J/f0Zewl5A bl4KdDgNSMtU0kOf4kjMlaJi77dwBmux3uZfWidNBllj5eqv3vLNm+bxDwJocyZsCS0g LS0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 90-v6si4996940pla.214.2018.02.05.11.00.19; Mon, 05 Feb 2018 11:00:34 -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; 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 S1753535AbeBES77 (ORCPT + 99 others); Mon, 5 Feb 2018 13:59:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51890 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbeBESYm (ORCPT ); Mon, 5 Feb 2018 13:24:42 -0500 Received: from localhost (unknown [104.132.1.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EDB2C10F7; Mon, 5 Feb 2018 18:24:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ingo Molnar , Dan Williams , Thomas Gleixner , linux-arch@vger.kernel.org, Tom Lendacky , Kees Cook , kernel-hardening@lists.openwall.com, Al Viro , torvalds@linux-foundation.org, alan@linux.intel.com Subject: [PATCH 4.14 41/64] x86/usercopy: Replace open coded stac/clac with __uaccess_{begin, end} Date: Mon, 5 Feb 2018 10:23:00 -0800 Message-Id: <20180205182140.266128654@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180205182138.571333346@linuxfoundation.org> References: <20180205182138.571333346@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams dan.j.williams@intel.com commit b5c4ae4f35325d520b230bab6eb3310613b72ac1 In preparation for converting some __uaccess_begin() instances to __uacess_begin_nospec(), make sure all 'from user' uaccess paths are using the _begin(), _end() helpers rather than open-coded stac() and clac(). No functional changes. Suggested-by: Ingo Molnar Signed-off-by: Dan Williams Signed-off-by: Thomas Gleixner Cc: linux-arch@vger.kernel.org Cc: Tom Lendacky Cc: Kees Cook Cc: kernel-hardening@lists.openwall.com Cc: gregkh@linuxfoundation.org Cc: Al Viro Cc: torvalds@linux-foundation.org Cc: alan@linux.intel.com Link: https://lkml.kernel.org/r/151727416438.33451.17309465232057176966.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/lib/usercopy_32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/x86/lib/usercopy_32.c +++ b/arch/x86/lib/usercopy_32.c @@ -331,12 +331,12 @@ do { \ unsigned long __copy_user_ll(void *to, const void *from, unsigned long n) { - stac(); + __uaccess_begin(); if (movsl_is_ok(to, from, n)) __copy_user(to, from, n); else n = __copy_user_intel(to, from, n); - clac(); + __uaccess_end(); return n; } EXPORT_SYMBOL(__copy_user_ll); @@ -344,7 +344,7 @@ EXPORT_SYMBOL(__copy_user_ll); unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *from, unsigned long n) { - stac(); + __uaccess_begin(); #ifdef CONFIG_X86_INTEL_USERCOPY if (n > 64 && static_cpu_has(X86_FEATURE_XMM2)) n = __copy_user_intel_nocache(to, from, n); @@ -353,7 +353,7 @@ unsigned long __copy_from_user_ll_nocach #else __copy_user(to, from, n); #endif - clac(); + __uaccess_end(); return n; } EXPORT_SYMBOL(__copy_from_user_ll_nocache_nozero);