Message ID | 20190110175150.5239-7-dave.long@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2176099jaa; Thu, 10 Jan 2019 09:52:01 -0800 (PST) X-Received: by 2002:ae9:dfc7:: with SMTP id t190mr9739407qkf.43.1547142721528; Thu, 10 Jan 2019 09:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547142721; cv=none; d=google.com; s=arc-20160816; b=L3yahRTNaeJJa7IB4IPlR2YPOS1qKyOSkoTDqxnZ1w51nD1Rc1SU+ctISGQLjd1qFP jdYJm8vjm/LooWnREZtf9+uCEZP+oU/2kYrJMTN6AkIryu4dF88BaQ/cClINYTP2Y5nC LVdPTxLGUP/53Cv+WO9pZV5UipU7Nz/nLnI4vGg0ghLXoehWPSNUtk4sXDNboDqLuG1c sZLeYzAVaSqGRV8eN5j3K0mWyHeWtUolJGcpXCHRN215CL5ERHn7sEbLl4/SJEd27/YG whsSGEQEO5O+ocMiQsU8G6++sYO8ZFImcbftQzFeM9PtIMoa9Q80jU0Brd959qFZ5wpY oGJg== 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=hBL7Wb0KdnmLsxeoxyLW0Tbkce8RSkol6PC9Ygx296g=; b=qrHZkVWoKChiFIdlqRUiNAn9cILSX+ErbPl5MZefwUvIaR5WUaKMEzdtki2Q9BGTtV erwbaePOfFXFubrP1slv1mcnfrPsv+KG2ji3khl+reLBgMvAUnC/LTtgidlF63go3n0N jPmHRi+XMQ1h7KwBRDaBwTWfRSndiLbiJUv20czTl1BVPwHtU469onWvtYktKfgIBElm Eap45dcW/pvXvEb5ee95gchuJgN9URraouuY42W+OyG1hKOtl4hdGN4O28718BmS+nj5 KBqGbXxgFM1pKzN3pdUb0Y4SHIOlkvG1qMyrfXttWKPx/coJBJmDvnPTK95k2+H5QDqv B4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MdjX6xpI; 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 k18sor67701928qvm.14.2019.01.10.09.52.01 for <patches@linaro.org> (Google Transport Security); Thu, 10 Jan 2019 09:52:01 -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=MdjX6xpI; 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=hBL7Wb0KdnmLsxeoxyLW0Tbkce8RSkol6PC9Ygx296g=; b=MdjX6xpIGP1iEyzIL4h+6OjyUFUzScmNRQb1WbwVJ6aOg6Xye+66YrBdM8u5tnT4VQ SrzCJMU6eH/jEhIfQEXrQ78TSlDp/CYp6FfEU6DDXrmFzUZYjeJWhECd+hbrjy5X7o0W p+WZq++ciOEGXMBCar7ZAjljSLc1b0ru6Fb40= 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=hBL7Wb0KdnmLsxeoxyLW0Tbkce8RSkol6PC9Ygx296g=; b=epOIrF7G0S97PrJWiCErmD6l2eiDiKuhhb7enr3gwJDOx8KH1vvi7c6BdX2wm2syhB zRPR3CpMTQk9T7Hf+Ygs5nhtp1m6Ckufr8Jl0xKi3pi0sp/GNRCzvJkstMJ+JQ4lngR/ /0Q6GreTlBCDzf5nNNz92Z9UgWJnwPaojNiP9BK9r6GpBbqG1c9ggyIemV3452pXck58 NEugTxIQGAl5BKJ5IxNFPJNYGaVjKHaSkkRIWk5tlxW9iOVeLAYnmqMEi7gZ3BOB9kPi WK6yITKZyGz6IbM8QMhUZrrWU9jqczMTqUtBpd/j0vMlAP9a4H5YfjIEUUjAlcYJ1gT6 Qhbw== X-Gm-Message-State: AJcUukfiIpfPJvQF+oG5obz3WDoCvbA09B0sF79rRazBqwPYAjlCm9h0 5IYa67SS49nZ2+eCuwrSqUWdobOe X-Google-Smtp-Source: ALg8bN7TjTLGNkajmfmOrVprL0m/k+WGLGwyM4ZTwT3sKkxg+w2oyZiwZtOxJ/HACjXjFCHQg1lkXQ== X-Received: by 2002:ad4:510f:: with SMTP id g15mr10969603qvp.46.1547142721287; Thu, 10 Jan 2019 09:52:01 -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 b8sm41815904qka.79.2019.01.10.09.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 09:52:00 -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>, Mark Rutland <mark.rutland@arm.com> Cc: Greg KH <gregkh@linuxfoundation.org>, Mark Brown <broonie@kernel.org> Subject: [PATCH 4.14 06/17] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit Date: Thu, 10 Jan 2019 12:51:39 -0500 Message-Id: <20190110175150.5239-7-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190110175150.5239-1-dave.long@linaro.org> References: <20190110175150.5239-1-dave.long@linaro.org> |
Series |
V4.14 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 4140be431087..7d19584f5c39 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -69,6 +69,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); }