Message ID | 20190213213223.916-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 69csp560854jaa; Wed, 13 Feb 2019 13:32:34 -0800 (PST) X-Received: by 2002:a37:884:: with SMTP id 126mr249454qki.56.1550093554397; Wed, 13 Feb 2019 13:32:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550093554; cv=none; d=google.com; s=arc-20160816; b=E/ZNILBXitt2nqbDDxjbskq9K0lWyAnWYch7ZwkIkduKpOd8JSvBanzvxa1AtDM4ca EPKcBhuqk309woK+BiqTgcQE+g8rutNwGwT6rSIpeE9WQkMK3V2l5u9sHqfJKHzBKOR3 g+7VKbFkVKZ0+Y4E8EidpjBmIjlWyBgwiRSi+6eqnXrgGUrtH7YwuSqGxuGbCh1o9n2h +kN4SGvHljmbyFIwavpjSFDtTxaJ+wM5Jjtv7pKoiszCBguXv2c6a+UsJIgQSjJyOgky z6HQf8UmFn4DOhssZV0oF5MatScrBz84sqMZRhvjm8zLggWiSKGLj9fNaEhE5ubAeprj Vclw== 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=dQLK2/rrLChjZCacrkpff81URBJeOtphw+yxRdVdzZ4=; b=PufJbICjJARFLnNRWxRZbgby64AbHXGoCtidA+AA2XUJUZ+YQFjEumfLBh66B7qtFg I5OzQMJBteqKMdbcpy3LNx45MqshxgLJ26QGCp6nWShJYCPcUan/Iho3TgOYJV1P8J0A aIVNeOCsD8omD4uIUnkuzonqJUQrH02hFXXqePQG9vSkJ3j66zughCFfKSDmBq8nPlrG KienfWMSiFgLHK9BKxK5W7Qj35N04usW+s7YFDXaa0JgLw3PaxMedcehchvMW4p89JZ8 S1NnXJMjT/2J3y/uANECSYFX91nT++DM+aS7l92/XSsS4CFTJ7cyw6rOyHd6U1HqCJLG Rr/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gQABb81M; 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 c17sor597755qtm.2.2019.02.13.13.32.34 for <patches@linaro.org> (Google Transport Security); Wed, 13 Feb 2019 13:32:34 -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=gQABb81M; 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=dQLK2/rrLChjZCacrkpff81URBJeOtphw+yxRdVdzZ4=; b=gQABb81MbKQBlmSXhqJWQfg/1AxyC7N9oosWf++hMdAGIruAgpqJYldwUqM1bmB6Jr dulsq1OpTXHG1i2jGcQeuZyZIpjlKNdKfSMyrS0u+NAnjSlxqj7zZ3qkDJYNjUsmUrJF zigsHfdtmvf3MT0gwEA2vuSBKY4RwNgfY025WHBxSsYe2wuncmOQ88OE0GyPQcL58ysd 4e65OoRDhrMM69gcPZUaLEQEaHinHgZEFhvilAAmkSckKd5/7GedCqUALyP0aiq2Fvxn HNIc7JEQhrKke9sonMbxjJlaZ3nPYoqJqcssm1/sMCPDAFExEk7IVkLGZUSwo359avMR lWKQ== 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=dQLK2/rrLChjZCacrkpff81URBJeOtphw+yxRdVdzZ4=; b=Rm8khYrlyU9bhDCY4SaEycWxZUYEy2CBY+aHNG47H0dp/qWHM9nySJ4wTE16cdBOc6 gKY+rgFFTwEl6GNL9YQ0RlKJGWEEkn+fDqT2yychdDqXqE6OAvScn6Q5rsop+d8P8qgl sJ1IFbPM6qwI29kVBQtgcQPWrDLn9AXj4zT1gcyjJlK/hWghVTLu4iKuwtH5SKT4Gkgr 8u7T4aGSaDCAgfgsbigGshSSfq0Rc/dUjEdUSYqY3/ThqkAg4DyIXjpDdW8icdeyhbHQ pHn1DZoqV0PslGaPiR3ODKNMjwjbMbKsLTDWThVs6xmc8XPetjgwrXxRx6XRlMcsJXv6 w4ng== X-Gm-Message-State: AHQUAubFhPt5EARXUSwf0F8zJQyd5UGAeJBkfDiWEZhIZ2hsYX/fpTbN ROZ9rBTS/4jFwK5OBda6meW1auzx X-Google-Smtp-Source: AHgI3Ia4pComQ8ctgxQDJ1CcQxaos+nBxL2y9DAGiemotoOFbJLoJ3KztZyURL89wAh+dQrfdS0EKQ== X-Received: by 2002:ac8:341a:: with SMTP id u26mr205865qtb.211.1550093554162; Wed, 13 Feb 2019 13:32:34 -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 8sm382675qtr.7.2019.02.13.13.32.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 13:32:33 -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.19 06/17] ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit Date: Wed, 13 Feb 2019 16:32:12 -0500 Message-Id: <20190213213223.916-7-dave.long@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213213223.916-1-dave.long@linaro.org> References: <20190213213223.916-1-dave.long@linaro.org> |
Series |
V4.19 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 5451e1f05a19..d65ef85fc617 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); }