Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp431284pxb; Sat, 6 Mar 2021 04:37:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLFWl8u6vQh7r86+9GHomnMQdMYx45WAHm9IjdcJDmoXJ3SSoes0RfVcpGxdGlyB5PrZm4 X-Received: by 2002:a17:907:1b1c:: with SMTP id mp28mr6557663ejc.243.1615034230738; Sat, 06 Mar 2021 04:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615034230; cv=none; d=google.com; s=arc-20160816; b=qTe7ck+6gDXfWDfscJ7MI99rS9x7WYkEni0O3j1927tzvB6ZYvnZLDWs9VUktJomgG qKDbwwWrrJez3zdUEPCaga369kRzTSGvRaHM1JEiIBqNqcn83uo7/Eeh3A3DyhojLpQV VmYWe0y2GC33QjE/fIi/0hyTnvT5irLJBUlZ62p6NGFmt8nZ+r2uFbK7gtAzOTiB2R4R oPOVgV+J/lfScthiyzTmkxDc8bzw03TjyPVygsJRFm76hymi17+oUajdhmqpucoaPgxB SIQhd4OPypv9sKclnqre/jfBOY32BCA8z9DjIKmN5Ls30zzgZDiUEyh8+1geWvj+9SQo wWRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9QHA/auC828Jqan2akyk0NJH1AQcH9ax/tK0w9DMNcw=; b=aY70mIT1WVPsUiJmFz6Tp6vnbd9xBbltX3330IuYTP5hzJWqnRanNjHEdkNzbQM9X5 AYRAKw2N7yEkzdNHpyQ9KSotVacAelgJko7vklT2PudUtcZuUSpCOQX80DSuZCcHuBnJ 9E87IVb/NJSEinRlVtDsPQjkL1Mx3PrcCWGuvxtwCfzVA57eqz5JgdB2C2nzqsp7/zjG zwRzW5a1ZvZ/YER9383G4UZzWC7n0jSKHogG9riaRIuXDniqJQbEhJJgxRYnHKOpTr74 HwvTyTxSufXeEHUYPrFiuyRxetXU/AMaZTpj6J444BYSSklHpd1or8SvjlBL+kAM+Qb7 BHNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjeGfMg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id j23si3318017eje.690.2021.03.06.04.36.48; Sat, 06 Mar 2021 04:37:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RjeGfMg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230426AbhCFM0Y (ORCPT + 99 others); Sat, 6 Mar 2021 07:26:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230409AbhCFMZu (ORCPT ); Sat, 6 Mar 2021 07:25:50 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 217ADC06175F for ; Sat, 6 Mar 2021 04:25:50 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id y12so7911760ljj.12 for ; Sat, 06 Mar 2021 04:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9QHA/auC828Jqan2akyk0NJH1AQcH9ax/tK0w9DMNcw=; b=RjeGfMg07ilX+5+ALabW4rNuZA59tc6R+55MKGqB7nmpBuwVwbWCyBDCJRIs9P7QTy 5BAqpbHKQPiz3s3ORQRNdCKy8vx+KKbW3sPbPHuvlcI4nj3wgl9sQS3bmaLvpE8vMwJ0 ngnc2n1J0TfkfJIorDuasnLUIGvdKUM9EERxb4uS4BOcxxDdAtv3fUxAErZSU4LJBbLe cXIQJuCKfywKJ+mPg7/Y0nTgHcq5BnkOI7u1cxBK+UHbj4j+tO/ilSEVW7cDKvI/IgTs SpLh7rpgi/11lncH87L6pRwn0bIKR2fzlSsGFGexrWck01+k15gXcybuHjkWZAYDXo+Z 6r8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9QHA/auC828Jqan2akyk0NJH1AQcH9ax/tK0w9DMNcw=; b=m4OTUDknfOVS5+0sww/lsKiBPfU1qVchwnfIhT4q8F3LYpTWWK2HAKyXhJEAESS1Re 6q11GVaFXaZOouMr+NrAG7Au24Jd+C8YR0rOKnoP68OYPVrCBh11evVbbUPGDf7zDP2D fLTWzPoLbZ425gU7TCc7/yPn6hiQhXd+pblTP6tZExdx1on3qKeNSoVzX60GyA3e+LKk aF4m4Xa3LrMX4vebeqYIdH12T7/Z7hBcLtt8fx8+xDrh2i4SLtDgj3QTq+cVvDSVwRYD x5uZTtJ9QfkuoUQJq0IDlV75bE8X6FuVpAmsNi8+lCzcyfbO+NTSj7h5K3UBYyjMIol3 wgTQ== X-Gm-Message-State: AOAM531aR73jiwSU5/hvtEmn9EwkoYD78K2TTw+XwVzFDeEBsEdm++6U LAX7k8Py1aQHbNLjuTS11zh/AqENp1XkSgrrC+Sz3A== X-Received: by 2002:a2e:9cb:: with SMTP id 194mr8159473ljj.438.1615033547728; Sat, 06 Mar 2021 04:25:47 -0800 (PST) MIME-Version: 1.0 References: <20210223023125.2265845-1-jiancai@google.com> <20210223023542.2287529-1-jiancai@google.com> In-Reply-To: From: Linus Walleij Date: Sat, 6 Mar 2021 13:25:36 +0100 Message-ID: Subject: Re: [PATCH v5] ARM: Implement SLS mitigation To: Jian Cai Cc: Nick Desaulniers , Manoj Gupta , Luis Lozano , clang-built-linux , Nathan Chancellor , David Laight , Will Deacon , Russell King , Russell King , Catalin Marinas , James Morris , "Serge E. Hallyn" , Arnd Bergmann , Masahiro Yamada , Krzysztof Kozlowski , Marc Zyngier , Kees Cook , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Ard Biesheuvel , Ingo Molnar , Andrew Morton , Mike Rapoport , Mark Rutland , David Brazdil , James Morse , Linux ARM , "linux-kernel@vger.kernel.org" , linux-security-module@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 5, 2021 at 12:23 AM Jian Cai wrote: > On Wed, Mar 3, 2021 at 7:04 AM Linus Walleij wrote: > > > > On Tue, Feb 23, 2021 at 3:36 AM Jian Cai wrote: > > > > > This patch adds CONFIG_HARDEN_SLS_ALL that can be used to turn on > > > -mharden-sls=all, which mitigates the straight-line speculation > > > vulnerability, speculative execution of the instruction following some > > > unconditional jumps. Notice -mharden-sls= has other options as below, > > > and this config turns on the strongest option. > > > > > > all: enable all mitigations against Straight Line Speculation that are implemented. > > > none: disable all mitigations against Straight Line Speculation. > > > retbr: enable the mitigation against Straight Line Speculation for RET and BR instructions. > > > blr: enable the mitigation against Straight Line Speculation for BLR instructions. > > > > I heard about compiler protection for this, so nice to see it happening! > > > > Would you happen to know if there is any plan to do the same for GCC? > > I know you folks at Google like LLVM, but if you know let us know. > > I think gcc also has these options. > https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html And how does that work with this part of your patch: +#define SLS_TEXT \ + ALIGN_FUNCTION(); \ + *(.text.__llvm_slsblr_thunk_*) This does not look compiler agnostic? Yours, Linus Walleij