Message ID | 20190214021022.5313-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 69csp793741jaa; Wed, 13 Feb 2019 18:10:33 -0800 (PST) X-Received: by 2002:a0c:afb6:: with SMTP id s51mr1058511qvc.34.1550110233335; Wed, 13 Feb 2019 18:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550110233; cv=none; d=google.com; s=arc-20160816; b=td8IjEF40dyzGPg8b7xgQtBu0nQvv9SuW22Hf0uE086sPRMgQ0oblXOXMgZfrhfYTP 8QqN4svDieimUqdqk/VW9bKI5/djRRE0Rg1l1Mz/x76vnuzSw8KmTo2pfmbp+NNQuPRX LpflVQt4PanOOhvdnpEfjAs6M0YD6z1iTvd/04DkIKV1Q0hgx9NDTEIM74KuAcHHI0jH MORBkESIjr/kGlmdXYwxXNp6ppvO4zPDXoAsIqrO5gkDMnOdU9Z4/Qil348Xzd77mycc KQYoflLgEJ9ohQOW/J89H8L9/btdOj1n2lcuzEbKdf3y8Kwlfs0S9P+Es/djq581LBsy Iy/Q== 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=Wqcb1if962tzGXnCePt8yIkA4x8h+UaToySloYGd7VhsDh8vVZIy+TIpBGpeDsb7x+ NctPR4rDft9oOLMHK+sMoELSQu76181z4NQOLxyikvQWyXq5X18pVTE+SvuCEgQZXMXt 84X1M+Hc/n+3v49PbXGkqSVRW0ZOXhNwWMjM5rU8bgcYrr9BVZUhojbAsgzvJEEDwj9r MRx6rSAZPVsHE1Pekm0YBJkQl31ZNG9YP+C/0DOi1qlX3qoeH2S3R8oufBdim75ggJOc xllnBeuxWzjcxGpuTfRmLKyYj4IVxglzYZTSq6BkFFImfpNxKaJ1CXIeU5+meHfZpu1P rs4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jG9k1VfQ; 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 n7sor630918qkb.138.2019.02.13.18.10.33 for <patches@linaro.org> (Google Transport Security); Wed, 13 Feb 2019 18:10:33 -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=jG9k1VfQ; 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=jG9k1VfQvhqa9stEBXoUgTnHpRsxJKHOyYG1WWAXTdx1CMzgOPJoBBGUK3dDuJh7Jt InBZGJo4lOLCvI5fafIqykZup//rOWKm1rhQbXJI6Cgp0A6/3aWXP39Wln9mMvJ9Rmj5 CzZIFCn1jm0BLYVKl0ftmtfkThwrB67I7iaifVBZG9noOu3KrdPiKNUIqQGHodhc3emd BzthAd+xwHF/wbv+FojoZDOaJHpKD+uLtVrcZFAJkNxjV4KdU5P4H040Mt0tR7UMl4wI 3wCjfWy0XONYeVhoqKFxSKt5W8XA69GqUoUNvM00LDjQZPvUvKQcNPVV+g+E8CU8Pp6y lGKg== 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=R+nW4NGwvJk49RO7d488du/630ajfNLnR9ZAwDwBRsvooFnqkLt8T0Tt0aNXd+BHrt 15H65cicX0+hgVW6ty7UzRlMYqDIgVPaOX3WZOE2fsrAS1KEWzL6xZBRsAsZueOXUNlA 3xmLhXKsIEglVU86/Hx9G72BDHok6fTxbz15hD/adiaDX9NvESWshaJ37zdcTV/TYxxT a1QQSqcr6hjjNX8dfb2fC5pG0MZIB9RoLI5hb42cMdHCQB5tPSwxp7v7kluqFBfPNM4w BAGlyC1HHod56y395g686skK8Qhvj8h04Tchv0jhnfkdhD/+Drz6OrVzIbD1/QjBcf+l 1DSQ== X-Gm-Message-State: AHQUAuZahZl9vIre17eb1v+LTt4qw/ybgnkLZ2E0zLErxb34kv0Nkc0Y ismJWEiONbXfVi0E97WJn3EeBy3P9e55ag== X-Google-Smtp-Source: AHgI3IZcpwfSnjhLIPi5nDo695ajgpwp3u6zeBChihrC0pKX9ABdZSdAuhmul8NHt/UhyoAjdzHMqQ== X-Received: by 2002:a37:4145:: with SMTP id o66mr920551qka.129.1550110233070; Wed, 13 Feb 2019 18:10:33 -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 d63sm1091575qka.22.2019.02.13.18.10.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 18:10:32 -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.14 V2 06/17] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit Date: Wed, 13 Feb 2019 21:10:11 -0500 Message-Id: <20190214021022.5313-7-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214021022.5313-1-dave.long@linaro.org> References: <20190214021022.5313-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); }