Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp97663imj; Thu, 14 Feb 2019 16:09:55 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia3OpCoBPtVH7DhNzVzj3oY2/jfS0+tc02Jqvb7JHYhIpSzzLvfK8dm2j/ap5/QfQp80vm+ X-Received: by 2002:a17:902:207:: with SMTP id 7mr2152862plc.142.1550189395031; Thu, 14 Feb 2019 16:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550189395; cv=none; d=google.com; s=arc-20160816; b=IFZhsSoJ0wUZPbNWom+LHdBrCAzCKtPB7eOKeydZVq5uR8y5qgUYfHsPJbPLr7m8kf fVnK3qdkkh9WsyZpgONcUvVcRwgvwXAJVZ1QytJqjK2qk/uGUaNZu513e0n7S1Bc805Z eqzORV3yhtWEIcXookELE4TDvjUIwVihqXOvx/Awo5hB1ohVHgkyHxSmwTNuoZ0hYd04 fU9tQQEntbyDxHrJT3dhetHJB4QQOGm9A9xoqPvg2ujr5kL3YN/+fXA3Ir64+OOHI2SX 0faC4QaQHKQ/Vk8Ibu/HH50NcK2pSjrYKYHO+UNqoTspAuFUorTHnxpQdKA8NpUGePYc 2Dcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=3EUxbJ4Gs2ebNHsOGp92F1GifsPVltaoVmIWi4xEEBo=; b=vhqmn5eUXgNew7s6a72dCq1wcT4RTmW8YTfRvOIVs62zhPVoocgsldKUfC2Lsp0xz/ 0FSw5wzWAzsirsNtdKFy5wptMwmIYhcz08jU4WqrJy9JAKu85rjFQrJWyDtB9QUu9yFS WkTnsiUjZloavrJsu7MfNwRC7Rq++9jo4UNGvehQlQ3MmFccsdPdpi2is4gnJFFteSLW WyNNZnQqtRAoV5uUcOu5+Fwg+wdtVZXqswHg1enm5+yvI1FpEBtD9lDpdhgVbW2UUedA 9oVCBlMWAYRnFdOy3JSXiPAq/Wtv+jakjz0bEgeN0729icgEmrcSvxErGh3kJA/UfaWP eiag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ioo7iJvX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si3853989pgd.57.2019.02.14.16.09.39; Thu, 14 Feb 2019 16:09:55 -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=@linaro.org header.s=google header.b=Ioo7iJvX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394859AbfBNOvL (ORCPT + 99 others); Thu, 14 Feb 2019 09:51:11 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:46107 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407293AbfBNOtl (ORCPT ); Thu, 14 Feb 2019 09:49:41 -0500 Received: by mail-qt1-f194.google.com with SMTP id y20so7026703qtm.13 for ; Thu, 14 Feb 2019 06:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3EUxbJ4Gs2ebNHsOGp92F1GifsPVltaoVmIWi4xEEBo=; b=Ioo7iJvX7d6MQbbygi6AqmTR717u8Nn9q4l6Lz9RRC1h2d3f5BI8HB987KC8ic+sht SQoxNNsUvDcnct0MF5I7HmqlYkNS2SnlTLS6JYqlJzKgIMXBTIjxD/ZV1tuqzpb8uBNH PT+t9K7fRpu0muIzuxJZ8aQn96cPNTdDS6TQkBjJDluavck2nBuD8bXJAUe6O24/tHBv IqnIxPiZ3ZUbgvPrcsMySFm4fRYjuYQ18ImpPHE0oknCl1zf75nzAP2rV/RLyoq3jQsY t32Aj633ROdtEItbocW7xgTqUgYH/Skv+qTXrlsGaJwxZDOZWqyXOnVmgqKtIjJhzjRX PAlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3EUxbJ4Gs2ebNHsOGp92F1GifsPVltaoVmIWi4xEEBo=; b=U/WKitwHINfDH8V7Z0u3C8THHkauuY+QfbwP6wpFK91qkP5J+7tS5ZHn73wNYbb/3b U5LXfhSZg3Ct9Q/1xV4pgPeq3OJIyHBp/soUm2ePI6AQJNz5OBz3AWR+q5UxKjWENsAO X3zUxk6Oc7axkdHpBEL6s0aR+ziKaaRRgayF5sBMr1UcrMs9Fh91XwgKNIkxE1qbTqhB cJAyMxXtPENLPDubAliRR1HfkRQtd1xzgtubYG7T7d+IlR90Jm7ucEnLig5R5C/hF5AJ Fi5MyO0vd6spnejfbFdsJO9cBCK/vDEXTJ3R5g25POLKycEuomG767ocmfgh4+nl2FfB tgAA== X-Gm-Message-State: AHQUAub2aN+MH3xjElp3rKaztZxdy5fUYuYa/dpCNRRIrFJmxxjmevwT r/GjxEVxMBekpkOLeqXnuAuj/A== X-Received: by 2002:a0c:8816:: with SMTP id 22mr3233956qvl.247.1550155781094; Thu, 14 Feb 2019 06:49:41 -0800 (PST) Received: from localhost.localdomain (pool-72-71-243-63.cncdnh.fast00.myfairpoint.net. [72.71.243.63]) by smtp.googlemail.com with ESMTPSA id k66sm1498919qkc.25.2019.02.14.06.49.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 06:49:40 -0800 (PST) From: David Long To: stable@vger.kernel.org, Russell King - ARM Linux , Florian Fainelli , Julien Thierry , Tony Lindgren , Marc Zyngier , Greg KH , Mark Rutland Cc: Will Deacon , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH 4.9 06/16] ARM: 8795/1: spectre-v1.1: use put_user() for __put_user() Date: Thu, 14 Feb 2019 09:49:20 -0500 Message-Id: <20190214144930.27539-7-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214144930.27539-1-dave.long@linaro.org> References: <20190214144930.27539-1-dave.long@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julien Thierry 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 --- 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 9ae888775743..b61acd62cffb 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -400,6 +400,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; \ @@ -407,12 +415,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; \ @@ -492,6 +494,7 @@ do { \ : "r" (x), "i" (-EFAULT) \ : "cc") +#endif /* !CONFIG_CPU_SPECTRE */ #ifdef CONFIG_MMU extern unsigned long __must_check -- 2.17.1