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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7FA8C433F5 for ; Fri, 29 Oct 2021 16:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9898A610E5 for ; Fri, 29 Oct 2021 16:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbhJ2QJC (ORCPT ); Fri, 29 Oct 2021 12:09:02 -0400 Received: from www62.your-server.de ([213.133.104.62]:35914 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbhJ2QJB (ORCPT ); Fri, 29 Oct 2021 12:09:01 -0400 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mgUNm-0000k3-R8; Fri, 29 Oct 2021 18:05:30 +0200 Received: from [85.1.206.226] (helo=linux.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgUNm-000NUT-9w; Fri, 29 Oct 2021 18:05:30 +0200 Subject: Re: [PATCH v2 1/2] arch/Kconfig: Make CONFIG_CPU_SPECTRE available for all architectures To: Mark Rutland , Pawan Gupta Cc: Russell King , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook , Andrew Morton , Masahiro Yamada , "Peter Zijlstra (Intel)" , Sami Tolvanen , Colin Ian King , Frederic Weisbecker , Mike Rapoport , YiFei Zhu , "Steven Rostedt (VMware)" , Viresh Kumar , Andrey Konovalov , Wang Kefeng , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alexei Starovoitov , bpf@vger.kernel.org References: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> <20211028134918.GB48435@lakrids.cambridge.arm.com> <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> <20211029092248.GA24060@lakrids.cambridge.arm.com> From: Daniel Borkmann Message-ID: <6130e55f-4d84-5ada-4e86-5b678e3eaf5e@iogearbox.net> Date: Fri, 29 Oct 2021 18:05:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20211029092248.GA24060@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.3/26337/Fri Oct 29 10:19:12 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/29/21 11:22 AM, Mark Rutland wrote: > On Thu, Oct 28, 2021 at 12:36:58PM -0700, Pawan Gupta wrote: >> On 28.10.2021 14:49, Mark Rutland wrote: >>> On Wed, Oct 27, 2021 at 06:33:22PM -0700, Pawan Gupta wrote: >>>> Borrow CONFIG_CPU_SPECTRE from ARM to be available for all >>>> architectures. This will help in configuration of features that depend >>>> on CPU being affected by spectre class of vulnerabilities. >>>> >>>> Signed-off-by: Pawan Gupta >>> >>> Given that spectre isn't one specific issue, biut rather a blanket term >>> for a bunch of things that can have variable overlap, I don't think this >>> makes much sense unless we're going to add finer-grained options for all >>> the variants, and IMO it'd make more sene for the architectures to >>> directly select the things that'd otherwise be dependent on this. >> >> Isn't ARM already using CPU_SPECTRE for selecting things: >> >> config HARDEN_BRANCH_PREDICTOR >> bool "Harden the branch predictor against aliasing attacks" if EXPERT >> depends on CPU_SPECTRE > > It's true that arch/arm does, but that's not true for other > architectures, e.g. powerpc or arm64, and and as above I don't think it > makes sense to make this generic in its current form because "spectre" > is a somewhat vague generic term. > >> This was the whole motivation for doing the same for x86. >> >> Adding a condition for all architectures is also okay, but its going to >> a little messier: >> >> config BPF_UNPRIV_DEFAULT_OFF >> default y if X86 || ARM || ... >> >> This approach would make sense if architectures wants to explicitly >> select the defaults irrespective of architecture being affected by >> spectre. > > If we're going to change the default for some architectures, I think > it'd make much more sense to just do that for all, without any > arch-specific conditionality, i.e. > > config BPF_UNPRIV_DEFAULT_OFF > default y Lets just go with 'default y'. The main rationale for this change was motivated by spectre, so would have been good to indicate this also with an explicit dependency for broken HW, not just help description. Pretty much agreeing with Greg here [0]. Eventually, we might need some arch generic way to determine arch- common spectre type bugs, so that for unaffected HW we don't need to apply some of them from verifier, but that's still tbd. Thanks, Daniel [0] https://lore.kernel.org/bpf/YXrTev6WMXry9pFI@kroah.com/ 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05CE3C433EF for ; Fri, 29 Oct 2021 16:08:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C61B9610E8 for ; Fri, 29 Oct 2021 16:07:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C61B9610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=iogearbox.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4aIg3TOe0rAfBY0gZKOfdcAnlnu3bg+Vrqt+YNQ/8/4=; b=PZbjrH3Hm/6mBbE0ysl6Jbr5oT 7ScgfoJdKVOhu3p2LdoM2cbe3BGxtdDiXsgDj//otxA+11q3iLcAF+XmNyr+tv02X7mcx+2agN0wk tT3ibIiYgfqdp0SVHH9IFYrWBc/ed3H4Ba+Cfx6TO/3ufRyEV38snjHnyOOcIc1YR1IEn1GhOe5oP NNOAW3HbcT4uPw4FacGeU/tY6lkJVTDOzV1fMtD8enuY8etb8DswERiHzg3PZyl50JON0Uh/BGMWx 9Vcb5yTe3GTgKTL77otnccu3hpgzkZPeLqUzNjgpSfTkxpBo7Bemf9RmFVb0BdfcCBLk1Q+5FRXbf fq93XWBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgUOr-00BPlp-3w; Fri, 29 Oct 2021 16:06:37 +0000 Received: from www62.your-server.de ([213.133.104.62]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgUOn-00BPkr-AA for linux-arm-kernel@lists.infradead.org; Fri, 29 Oct 2021 16:06:34 +0000 Received: from sslproxy02.your-server.de ([78.47.166.47]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mgUNm-0000k3-R8; Fri, 29 Oct 2021 18:05:30 +0200 Received: from [85.1.206.226] (helo=linux.home) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgUNm-000NUT-9w; Fri, 29 Oct 2021 18:05:30 +0200 Subject: Re: [PATCH v2 1/2] arch/Kconfig: Make CONFIG_CPU_SPECTRE available for all architectures To: Mark Rutland , Pawan Gupta Cc: Russell King , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kees Cook , Andrew Morton , Masahiro Yamada , "Peter Zijlstra (Intel)" , Sami Tolvanen , Colin Ian King , Frederic Weisbecker , Mike Rapoport , YiFei Zhu , "Steven Rostedt (VMware)" , Viresh Kumar , Andrey Konovalov , Wang Kefeng , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Alexei Starovoitov , bpf@vger.kernel.org References: <232b692cd79e4f6e4c3ee7055b5f02792a28d2c4.1635383031.git.pawan.kumar.gupta@linux.intel.com> <20211028134918.GB48435@lakrids.cambridge.arm.com> <20211028193658.7n2oehp6yogyqbwq@gupta-dev2.localdomain> <20211029092248.GA24060@lakrids.cambridge.arm.com> From: Daniel Borkmann Message-ID: <6130e55f-4d84-5ada-4e86-5b678e3eaf5e@iogearbox.net> Date: Fri, 29 Oct 2021 18:05:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20211029092248.GA24060@lakrids.cambridge.arm.com> Content-Language: en-US X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.3/26337/Fri Oct 29 10:19:12 2021) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_090633_367701_02D979F8 X-CRM114-Status: GOOD ( 27.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 10/29/21 11:22 AM, Mark Rutland wrote: > On Thu, Oct 28, 2021 at 12:36:58PM -0700, Pawan Gupta wrote: >> On 28.10.2021 14:49, Mark Rutland wrote: >>> On Wed, Oct 27, 2021 at 06:33:22PM -0700, Pawan Gupta wrote: >>>> Borrow CONFIG_CPU_SPECTRE from ARM to be available for all >>>> architectures. This will help in configuration of features that depend >>>> on CPU being affected by spectre class of vulnerabilities. >>>> >>>> Signed-off-by: Pawan Gupta >>> >>> Given that spectre isn't one specific issue, biut rather a blanket term >>> for a bunch of things that can have variable overlap, I don't think this >>> makes much sense unless we're going to add finer-grained options for all >>> the variants, and IMO it'd make more sene for the architectures to >>> directly select the things that'd otherwise be dependent on this. >> >> Isn't ARM already using CPU_SPECTRE for selecting things: >> >> config HARDEN_BRANCH_PREDICTOR >> bool "Harden the branch predictor against aliasing attacks" if EXPERT >> depends on CPU_SPECTRE > > It's true that arch/arm does, but that's not true for other > architectures, e.g. powerpc or arm64, and and as above I don't think it > makes sense to make this generic in its current form because "spectre" > is a somewhat vague generic term. > >> This was the whole motivation for doing the same for x86. >> >> Adding a condition for all architectures is also okay, but its going to >> a little messier: >> >> config BPF_UNPRIV_DEFAULT_OFF >> default y if X86 || ARM || ... >> >> This approach would make sense if architectures wants to explicitly >> select the defaults irrespective of architecture being affected by >> spectre. > > If we're going to change the default for some architectures, I think > it'd make much more sense to just do that for all, without any > arch-specific conditionality, i.e. > > config BPF_UNPRIV_DEFAULT_OFF > default y Lets just go with 'default y'. The main rationale for this change was motivated by spectre, so would have been good to indicate this also with an explicit dependency for broken HW, not just help description. Pretty much agreeing with Greg here [0]. Eventually, we might need some arch generic way to determine arch- common spectre type bugs, so that for unaffected HW we don't need to apply some of them from verifier, but that's still tbd. Thanks, Daniel [0] https://lore.kernel.org/bpf/YXrTev6WMXry9pFI@kroah.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel