From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 319F6C433E0 for ; Mon, 22 Feb 2021 21:51:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9A5D64E02 for ; Mon, 22 Feb 2021 21:51:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9A5D64E02 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ecg5pT04o6EM6F+D8z15ToexV6JPCHJVlB/oeakKoY=; b=ZYOD3wZUiluByCHkbAauQ81kx 1XCujBxrpqCdmawNN+vyVjUyDpa42vgdQliLkkNf/vY49+m8wf/Ty5GGv0dBUxmL6YCZ4jE5JBxZG TLAmCUrvbUpu94mVHTfaSTKOZPlbUFhKoE8Pe9UXGUF3wYGtvck9aW8rU0pqtA09PGNGQcnYQpAeF mMstFEd7GhoD7r7MjEMWPvqat+k7Oj+rgZn+DG7wYgvpe3jRgS1eONSrse4fWY7OZ/2vJm+gypio1 k6Fv2R39B6yMqtB5oX5N9+2J1c7TODTxWqgbVoX46Q0MK5/bhP14bRgO4CCFt2bkkMgD5thbZM4Gd k3wh5QhEg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEJ61-0004VS-Ia; Mon, 22 Feb 2021 21:50:25 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEJ5y-0004Ux-VO for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2021 21:50:24 +0000 Received: by mail-ot1-x333.google.com with SMTP id r19so6279672otk.2 for ; Mon, 22 Feb 2021 13:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5XvA1Gvev4npN0zTNKBUEQYu6pllkjUp8fGvFiKGsaw=; b=oPaglzkjKqzjUBBPUjqw1unuPnLeRIg+r2e+b5ukaQtb/CbFhejThtt83WKjf+uRWe KFn/OkCiXG7jSjp1nQqXY7tjbvTf6QKmcEGby7qkIb8lTX8W2xZOw+NEjkaHyfb0y83y ZL+/Nco8WNGPOhZcKSnj8kGXbTy3hmoHvPFDTRmyYdxWIcPQ54CtQgUtuwa8DFf9vEGZ pUm8rMXHgVXxuoQucIETk3LjqO7v1JwBhPM7k+lXRB6icRyOfS9oD86WvjI17VK+uYfp ZyD1JnASki0fT4pyG0rrTfuzd7T0o/Nhsr55gPy5LF7wJRo15112lYcAy/Ycx2KGYYJc WSdw== 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=5XvA1Gvev4npN0zTNKBUEQYu6pllkjUp8fGvFiKGsaw=; b=YaJMHr6INwh8JCvqrduEdSom6C4RE7/e35rqiT8py5yxPrwD72GKmeUxnM7gQTaNFp HIb6MBHgR4ozoWQw0YebX+Ioa9KT03yC7DEHq74R/gs1UNopQEIA0f+dSp6ZkpMBqEyN 9hwt6+Zr99e5jeLyDOEKF9TdwBj0o/E7mYsHq+xBylGHGE4EMT8gboMU+XxJ3gngzj8e rknXHFX+zh4jEoIFvJvUJjd4TsIZOwE7ummqqiO04akhtQoA8nvPdVCBLyXPkxVECDZI Hdh6K1FfuEUtSjH1aNwnjufEz0iYUKtcR7o+xty8C2pgwoXA45hPTZSJS2y4gxpcLJBL a/7g== X-Gm-Message-State: AOAM533POA84ZMaN9VXpQfki3IRN4ftoxE+Jf4bqVzdjbQ16Tey89y9A X512qhanH50azQCa63Kpcw7mJA7dqYtwSgQLLXx58Q== X-Google-Smtp-Source: ABdhPJxMYKRODjg5XZiabTyJz9ooiRtNu/86y64qGHku2dN8574FUKIwnz31nIc7J8RgCH9i500XWk553hkczvcZYCM= X-Received: by 2002:a05:6830:1def:: with SMTP id b15mr18107040otj.111.1614030617845; Mon, 22 Feb 2021 13:50:17 -0800 (PST) MIME-Version: 1.0 References: <20210219201852.3213914-1-jiancai@google.com> <20210219230841.875875-1-jiancai@google.com> <20210222115816.GA8605@willie-the-truck> In-Reply-To: <20210222115816.GA8605@willie-the-truck> From: Jian Cai Date: Mon, 22 Feb 2021 13:50:06 -0800 Message-ID: Subject: Re: [PATCH v4] ARM: Implement SLS mitigation To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_165023_174569_808FA924 X-CRM114-Status: GOOD ( 26.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , Linus Walleij , James Morris , Manoj Gupta , Ingo Molnar , Marc Zyngier , Masahiro Yamada , Russell King , Ard Biesheuvel , clang-built-linux , Luis Lozano , David Brazdil , "Serge E. Hallyn" , Kees Cook , Arnd Bergmann , Nathan Chancellor , Linux ARM , Nick Desaulniers , Linux Kernel Mailing List , linux-security-module@vger.kernel.org, David Laight , James Morse , Andrew Morton , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Mike Rapoport Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Please see my comments inlined below. Thanks, Jian On Mon, Feb 22, 2021 at 3:58 AM Will Deacon wrote: > > On Fri, Feb 19, 2021 at 03:08:13PM -0800, 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. > > > > Links: > > https://reviews.llvm.org/D93221 > > https://reviews.llvm.org/D81404 > > https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/downloads/straight-line-speculation > > https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability/frequently-asked-questions#SLS2 > > > > Suggested-by: Manoj Gupta > > Suggested-by: Nick Desaulniers > > Suggested-by: Nathan Chancellor > > Suggested-by: David Laight > > Suggested-by: Will Deacon > > Reviewed-by: Nathan Chancellor > > Signed-off-by: Jian Cai > > --- > > Please can you reply to my previous questions? > > https://lore.kernel.org/linux-arm-kernel/20210217094859.GA3706@willie-the-truck/ > > (apologies if you did, but I don't see them in the archive or my inbox) I should have clarified the suggested-by tag was in regard to the Kconfig text change. Regarding your earlier questions, please see my comments below. > So I think that either we enable this unconditionally, or we don't enable it > at all (and people can hack their CFLAGS themselves if they want to). Not sure if this answers your question but this config should provide a way for people to turn on the mitigation at their own risk. > It would be helpful for one of the Arm folks to chime in, as I'm yet to see any > evidence that this is actually exploitable. Is it any worse that Spectre-v1, > where we _don't_ have a compiler mitigation? > Finally, do we have to worry about our assembly code? I am not sure if there are any plans to protect assembly code and I will leave it to the Arm folks since they know a whole lot better. But even without that part, we should still have better protection, especially when overhead does not look too bad: I did some preliminary experiments on ChromeOS, code size of vmlinux increased 3%, and there were no noticeable changes to run-time performance of the benchmarks I used. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel