Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1885007pxb; Fri, 5 Mar 2021 01:57:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQjjKVf7qqAdt2XoxbDt7F2gVrRVj9K6nNfld0xZw+xs+MXWh9gWxYYHB7VWvpz6ITd+F5 X-Received: by 2002:a17:906:22d4:: with SMTP id q20mr1628119eja.54.1614938229031; Fri, 05 Mar 2021 01:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614938229; cv=none; d=google.com; s=arc-20160816; b=i0NAWxaXHgJun54CgfV8g2xdYUC3veQ5MMY9Mi7jCk+QF6pEXw6ggWTOcxrFB5+l3i 1wbwIXxMsjmQIS3SheM/lQ1+vqzxkaAkpTdF7XCm6/kvqUpWJK4sNUAleCV59FgSzGRX Up2clmMUUfvu4Ia/zSdNN4A9CqWJ3LM1w8dCMMxw+ftFtUpjHkKKpvGk66gd33gZ35Wx vByiWzHAF0YLJkEpUQS6l1VMAHigAPx3YsTB0hImDH+Bvd2ac+2Id6//t+3KUXFulTG/ nCNNUK71xDTeBXr/a1avsVhj9/sDnh/6A4c1AZv1jKsMm1lVoikjMFtHJXRgZrATossl 622g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9EBMnLi+sHN2pg+K3LAaPu5cq9YAFd2LwZTaTfKUpWw=; b=yCzVkXtJJcbpaH3qqHceNv7ykh/clS1GWcNHgAYbmQVtBL2zsVsNOlNvc1XEEVJYXb HCjRDEbLfW+QSR3ojRfHKWYLm/D6MFUlC8BPImiU8geF7SYOLaGvLufQ6X/hIDV2Se9Z 7XmMA6U+eZeTTjVnWV6dXnD386i9P97IjVQ3Gl8MOXWiF/fz7saMW8nGoON0vnYl0fRE yS2a68BaLFkw471qcJZPR6oTEVoLJvs9Dw/F05WYZ0pFtac+6rYFZdtGlKaeKP/F2BQV ZSS8M6sHul4v/JcfspsiXFyoMVbhMX/SFTAfmwzYu7VRMAY7DHpZ76VEvob4RnYgzg/n m58Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ROvsjQ36; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si1191241eds.285.2021.03.05.01.56.46; Fri, 05 Mar 2021 01:57:09 -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=@kernel.org header.s=k20201202 header.b=ROvsjQ36; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbhCEJxi (ORCPT + 99 others); Fri, 5 Mar 2021 04:53:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:43412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhCEJxG (ORCPT ); Fri, 5 Mar 2021 04:53:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F75A64FF0; Fri, 5 Mar 2021 09:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614937985; bh=HISQ8FVK1FEQR2uPQffgIVaQdAag9fQWCstT9nYNRR4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ROvsjQ369W4Mti4eFRR1Wc1FOLTKKFKDEmwei6CFzaQJ6Qz9XT2wuHNZm6UJ42/Wq mswZpqhpLsCDqTifukAomcs2qL1z4XIMdjcBZZM7Wjbm48ywRY6plez2k5ozqzGN6W D3VlwYCsFcbXFXY6lSs6p/h6jvgiebLp+/iyQEFkvAKLED4VKfA9g5+J8lNWwOiO1V X4eqtyYUhRI5GSk8s/r3nXkcn58FKOIvEYxyu1IxhWaEviTywIQHxMLqCRsNsNJUCc 2hEA6hswMuFWi6efEqyoq0eVdEwptFb7eTf8f7HTG1XX63xQuAE4gu7x2Rv4uYt3QD 17AhWxXZziwpg== Date: Fri, 5 Mar 2021 09:52:56 +0000 From: Will Deacon To: Jian Cai Cc: ndesaulniers@google.com, manojgupta@google.com, llozano@google.com, clang-built-linux@googlegroups.com, Nathan Chancellor , David Laight , Russell King , Linus Walleij , Russell King , Catalin Marinas , James Morris , "Serge E. Hallyn" , Arnd Bergmann , Masahiro Yamada , Kees Cook , Andreas =?iso-8859-1?Q?F=E4rber?= , Daniel Palmer , Ard Biesheuvel , Ingo Molnar , Vladimir Murzin , Marc Zyngier , Andrew Morton , Mike Rapoport , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Mark Rutland , David Brazdil , Joey Gouly , James Morse , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH v6] ARM: Implement SLS mitigation Message-ID: <20210305095256.GA22536@willie-the-truck> References: <20210223023542.2287529-1-jiancai@google.com> <20210305005327.405365-1-jiancai@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210305005327.405365-1-jiancai@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 04:53:18PM -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 I'm still reasonably opposed to this patch, so please don't add my "Suggested-by" here as, if I were to suggest anything, it would be not to apply this patch :) I still don't see why SLS is worth a compiler mitigation which will affect all CPUs that run the kernel binary, but Spectre-v1 is not. In other words, the big thing missing from this is a justification as to why SLS is a problem worth working around for general C code. Will