Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2475775imj; Mon, 18 Feb 2019 06:40:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IbFGSGKGTZjfmln9xwecE+5qB0G2oI1pXceS/6UbVWy+0TcntMZFlGaY56xfknP8CixHOSC X-Received: by 2002:a63:94:: with SMTP id 142mr22708593pga.74.1550500836751; Mon, 18 Feb 2019 06:40:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550500836; cv=none; d=google.com; s=arc-20160816; b=EY0alTZMFhUOzHghysr7xvvysbUVv/OcWgQDOdLXjr0q4j+6RHlZgNPxnJgkIt8hSj 09lltfC8yj58svsCF8AdZHi/94zHf53IIRje8cPz1vYBzu9HAffDkA7hVCtFV3Kp3TX+ AmDZCCO+wbwWQE3dZG8ggWmswMuswk3VcCKoD+n7WhtnX7xBtfpNm/+i9KLKa3cgIBK0 7WOyyB1aczNXLMnYPtEKdJ4IjiCfSvLKiE31UhvhfI+LBj3cYAZ97FDVVTfRWdbK0Ujj cSFV0ld100yTKesXD2ZGDJSAeKUPZGJRG34z5GdND4o9npXOoxdRe+8jqlv70c8P7J1O NPgg== 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=q6G2nlOv2fsBmAhWyRW/QIYrV00Sc05Tq9KMTjPha9o=; b=cmupSEiVE4RlVfAQQTKjd3dkaz4x9CsKspbM9K37Th5U/FVnimjwVHIx7nXgQN0zYC M/ZDr9T8Viel56lPdkvnNXKcDjewmqOJpnWAwdLTcgwDU49Ix6/+I9ARJ/d+YR5SB3aE +EONhUPcJccY1a1vU6JPiHifxoQwyEl6pC3NPjwa93YNXAMdRcdL+2mDKO8m3bzmOCtJ vXU5GDCVWLZX9vAYJU0Jn1/e20lpYBLcUlgunekvcmCNX6A4ErlA1rVfYI+T9BK2RsT7 ZJiWtKCwRBm+4biqtRtWaaG0aYxn12fo+Wc5/GHqvw/JRzBLKk/xb4PqDsty2pRTc8vz 45Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Fdz8Qjnd; 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 o3si2658320pgh.189.2019.02.18.06.40.20; Mon, 18 Feb 2019 06:40:36 -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=Fdz8Qjnd; 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 S1733165AbfBRNyX (ORCPT + 99 others); Mon, 18 Feb 2019 08:54:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730643AbfBRNyW (ORCPT ); Mon, 18 Feb 2019 08:54:22 -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 130D92089F; Mon, 18 Feb 2019 13:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498061; bh=ZBM617/TzF0M+84GDuDkTSw2f0OYdY/H47FQF2lziIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fdz8QjndW7F1sYHD0YzRHGkx2ph7PRzFOw21hXYxGS9RF7UV7suMA5wRr8ijSBgDr Rtvpaat7YZXauhn7tGKE3QhKrZFYwaFls3Leq8d2IeCMEVGMFy+qCJxkrIX4Itd0IK WN6Ez+CCDC/msauTJ6Hpo52UjTlw56BF5cnF9Yhg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Thierry , Russell King , "David A. Long" , Sasha Levin Subject: [PATCH 4.14 11/62] ARM: 8795/1: spectre-v1.1: use put_user() for __put_user() Date: Mon, 18 Feb 2019 14:43:17 +0100 Message-Id: <20190218133506.795518298@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ Commit e3aa6243434fd9a82e84bb79ab1abd14f2d9a5a7 upstream. When Spectre mitigation is required, __put_user() needs to include check_uaccess. This is already the case for put_user(), so just make __put_user() an alias of put_user(). Signed-off-by: Julien Thierry Signed-off-by: Russell King Signed-off-by: David A. Long Reviewed-by: Julien Thierry Signed-off-by: Sasha Levin --- arch/arm/include/asm/uaccess.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 7d19584f5c39..cf50b030c62c 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -370,6 +370,14 @@ do { \ __pu_err; \ }) +#ifdef CONFIG_CPU_SPECTRE +/* + * When mitigating Spectre variant 1.1, all accessors need to include + * verification of the address space. + */ +#define __put_user(x, ptr) put_user(x, ptr) + +#else #define __put_user(x, ptr) \ ({ \ long __pu_err = 0; \ @@ -377,12 +385,6 @@ do { \ __pu_err; \ }) -#define __put_user_error(x, ptr, err) \ -({ \ - __put_user_switch((x), (ptr), (err), __put_user_nocheck); \ - (void) 0; \ -}) - #define __put_user_nocheck(x, __pu_ptr, __err, __size) \ do { \ unsigned long __pu_addr = (unsigned long)__pu_ptr; \ @@ -462,6 +464,7 @@ do { \ : "r" (x), "i" (-EFAULT) \ : "cc") +#endif /* !CONFIG_CPU_SPECTRE */ #ifdef CONFIG_MMU extern unsigned long __must_check -- 2.19.1