Message ID | 20190214144930.27539-6-dave.long@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1462190jaa; Thu, 14 Feb 2019 06:49:40 -0800 (PST) X-Received: by 2002:a37:9d56:: with SMTP id g83mr3053561qke.351.1550155779991; Thu, 14 Feb 2019 06:49:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550155779; cv=none; d=google.com; s=arc-20160816; b=uuVMBLNow2iLPwVDLt/sNitKAVprtSrlCQ158lu4ENjCv6nvnEN/tteMs5BNnfnP9y t4x/jOMQAnPXc1jfOWVlICEqOfBUT/Gj9TIWz3II/yTDPkyTYFNXJG/9QWmM/Dz3HQU8 Aghu6seFI5omv4GTdfWgXa0G0SOb5E6z/MkisZ1rnWQjPRMlXcob2Gxg9kOH0SE9AP9p BZSrJaemGZUh4r7s/9N3C8cTofBr7tWbkuIxJJmlIBuD/Kio+fPf4s5B+fT8ekt2PCa9 Vc/lpD8TPrqFczfQMNcbjNneS493mEpXHz+Cb4dPY6ker6fsGoi6upOKXbmjiPmfJeGz S1Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zCTqVlx5Etjzo5hueWu7ypOoXoXF8xnytS5XFeEjaGs=; b=P2FKc2kfByNRWoFI/VXjPnI7M8RWvKBN+nDeQ2E86KqRsroEgh+B/3BQ3PwiBTKdym bvUboRsm6pZPhQI/FF/EuxAplTxz5eu1nKXA9x4/KdSVG27Q/QaynFUQnVCALgcZHJw8 V/Bkpb5B4Qqr+UZgMx3JfpkKyuUvPRvLWXGaoN+jsi3zMACNHegKWKsUt2mBdx1zgmwE G+1TPDTLjRE1z18NiqBIMPq5M6wZcHWfpFFEnI/TlxYyhxrdUj6ymeYjsNHzWabC11hz O9K7AKmNOB6kdWHDWcs71qPHGQhBNRjzesXwrWKvsuDvVWYlJlSwQtzcA/jzbe3DsY9I V/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=miavcMRK; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <dave.long@linaro.org> Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id n30sor3229375qte.43.2019.02.14.06.49.39 for <patches@linaro.org> (Google Transport Security); Thu, 14 Feb 2019 06:49:39 -0800 (PST) Received-SPF: pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=miavcMRK; spf=pass (google.com: domain of dave.long@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=dave.long@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=zCTqVlx5Etjzo5hueWu7ypOoXoXF8xnytS5XFeEjaGs=; b=miavcMRKjxTTt1NnXSs9S5SIgv6tQi9tuaM3o7X7tprvmlvmHyoXop5aflXJXeIkxx do6zn2NQHvlyFLkcgrVE8GxZj3wMi/CVz+CAeO2sqXb6/JH+94dcqoo6axIotNkQff+y nS0SpEGNhIyWDYBl0wL/nOf4e/jaDpfvwpp1OV/osZTnnbxkBW83unDmtBBHN/lQA1w6 9pC94Au9Z8viUxDsy4X6o/h3vdSZrDOs3mAZ8WYwEDDgb7YDGS3LA1ga3UIJ4UFLuCRp wz7fH4hU0moX1giYjpcsYQlvD6N7pgpZWQN/iAIubXQpPjWD3vN9huAkB0S0ACkixiWv n+Lg== 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=zCTqVlx5Etjzo5hueWu7ypOoXoXF8xnytS5XFeEjaGs=; b=B5mph2l6Y8oC/l53eLtUduVFYRBvF9fceLutLLR8WuKgawqDJk2bkpJWBGUwM0lGCY dYSzx7LjlID4brg0NPPBzNWLQ7wSEK4CC4bUBovzDOI7X3eYLt91+JQ8R4YKxXkYUCZ+ GSl+2ZdUqDDAH8hYMtECb3c3WOATuMfmZkic8ABmiaHTwJjrIQKb81QosGyZGl2BYwLW 1FU07Vb8Wa8NPNVMh/enPJQvXIELRoenFQ5OjSJcDAs1HKUhmyYpbS+svuqPR2FOjFHL CUAR5tupigVhVuP0pdF1mXz3mkOFWv2qHeYjxyVrSA+4BiLk5ZOEfDKXoZ8P0ZwOdRLS GDCQ== X-Gm-Message-State: AHQUAuaXyxa4XpvUK9++g86aG/xBU9oeU8OPRyZ5yMInZmwihHu8cYqL waBDPfsgV0ekH0VpDoxNVO4P22JI X-Google-Smtp-Source: AHgI3IYuyKJfKTx5XoJwsHlZqWG3Jx+9E8LTTDtKIppzoB5eOlCS7mWVYLojIewdtsIltstdjCU/kQ== X-Received: by 2002:ac8:26ea:: with SMTP id 39mr3372612qtp.351.1550155779753; Thu, 14 Feb 2019 06:49:39 -0800 (PST) Return-Path: <dave.long@linaro.org> 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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 06:49:39 -0800 (PST) From: David Long <dave.long@linaro.org> To: stable@vger.kernel.org, Russell King - ARM Linux <linux@armlinux.org.uk>, Florian Fainelli <f.fainelli@gmail.com>, Julien Thierry <julien.thierry@arm.com>, Tony Lindgren <tony@atomide.com>, Marc Zyngier <marc.zyngier@arm.com>, Greg KH <gregkh@linuxfoundation.org>, Mark Rutland <mark.rutland@arm.com> Cc: Will Deacon <will.deacon@arm.com>, Mark Brown <broonie@kernel.org>, linux-kernel@vger.kernel.org Subject: [PATCH 4.9 05/16] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit Date: Thu, 14 Feb 2019 09:49:19 -0500 Message-Id: <20190214144930.27539-6-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> |
Series |
V4.9 backport of more 32-bit arm spectre patches
|
expand
|
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 7b17460127fd..9ae888775743 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -99,6 +99,14 @@ extern int __put_user_bad(void); static inline void set_fs(mm_segment_t fs) { current_thread_info()->addr_limit = fs; + + /* + * Prevent a mispredicted conditional call to set_fs from forwarding + * the wrong address limit to access_ok under speculation. + */ + dsb(nsh); + isb(); + modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER); }