Received: by 10.223.176.5 with SMTP id f5csp2849103wra; Mon, 5 Feb 2018 10:55:05 -0800 (PST) X-Google-Smtp-Source: AH8x224WBh6pkrob/6ZbE/1oRxGixTuWay/h/m3JHeiu4Z47lskQtInjdn2ld/VDQqleLWDzEvig X-Received: by 10.98.214.206 with SMTP id a75mr5465078pfl.104.1517856905686; Mon, 05 Feb 2018 10:55:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517856905; cv=none; d=google.com; s=arc-20160816; b=1IJzNA27Seog3vewc16sZY6nkRRsHYKVldtUUz3JgiRB7T++u8C0xbxPTAQ+VbVppR E7ephMfCPK65E8IU4NNBaXvIVCQzTu/aDacI4KHOVmNM5cXK+rn3Ju0/4YS34M5Zlk9y SoxMBTugV4Bm83EGE74GHNyMKrFbi3GZaT2QGIMWpE91edd0X86hhRmaEdETvpsgwzkI nTlKs03NsARi5flavu0QK12MDZ1uZGw3tX44kCBWJKEyYd+4rlPgx0hs6QECsoHcxM9x 8CSdSWzKWjEYpQLGxEFWbDoErrRhVdrrhvj5YulBx3xVJADPvP7/xEzM11rs4hVRTgv8 46gw== 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=AjWaYYVRHVrrbCDSTkPUaDmfm98xKdt76jMFyP/RDJ8=; b=Etm3iL2P1jatk1fV9bso6G3R7ox46qB9NVBnuAODiLHaarb4hl3YDdm7eaCPVmqNcP pvsYpVAmi6B0Z4DfThWD5pff8G5YeFYt40Wi++1AxloTMARkV9qPqOVYPjS5us+md7Pf lr1ZLKmSkCfQftHAwDK4HY0CT7IJtuLW+f4ehfKgm/lkluj3rEPGAl1AYPQiBlntfjdD f7IULhVLywwi7ets0pEii8zUgCqNMRGZkyprp9msiNTfbLV+h38eJNJlsl8eLoqLAIqR SR2OI9Foy7rZvo0pJlsDE5OC77Czpa3Mt48PQhLEQ8NwSMWzxjWyjmDvqQ/W9Wrn8VW3 jo1A== 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 c190si3132892pga.810.2018.02.05.10.54.51; Mon, 05 Feb 2018 10:55:05 -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 S1753837AbeBESyb (ORCPT + 99 others); Mon, 5 Feb 2018 13:54:31 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52738 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753766AbeBESZf (ORCPT ); Mon, 5 Feb 2018 13:25:35 -0500 Received: from localhost (unknown [104.132.1.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C46F6113A; Mon, 5 Feb 2018 18:25:22 +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.15 37/60] x86/usercopy: Replace open coded stac/clac with __uaccess_{begin, end} Date: Mon, 5 Feb 2018 10:23:10 -0800 Message-Id: <20180205182215.491244329@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180205182213.902626065@linuxfoundation.org> References: <20180205182213.902626065@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.15-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);