Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp488712imw; Fri, 15 Jul 2022 07:12:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uL10jmuUz0FcMjYreT0aVXmUmYci6Oyu7i5KMbLJq3m3DFTm7N9wZzfSjkUlUyvlld06CD X-Received: by 2002:a17:907:2d8b:b0:72b:7152:aa6a with SMTP id gt11-20020a1709072d8b00b0072b7152aa6amr13931870ejc.732.1657894326695; Fri, 15 Jul 2022 07:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657894326; cv=none; d=google.com; s=arc-20160816; b=Ug0IH60wZahFwqErkXbBEMQQgspxupZ6hgI5dXq/OQpEFGA9Fjf6LbnKdW7Ph4Q5eZ XLQjCvoVyyWVNDpDSlsAyNwDrzPDoLnNqbrxd4x4J7Eucc5Wdg/gDhm4TgjqN1D27NCl yY9uS0wz6vZ8+PcBhqmP/E0okU+kg4pcrwZKvn5v2hN8R7hAS5swBWpR11ct2tC/7O4D cIH9tafVWzNlfUkhm1md3+A+n1/qd2Mmt3sD29NooyCDI/iv2UHCgiFBIOFEvfa0FVHi FhGJbSV6Kghjw0XnhjFNHz+Jjf8ySKSBHe2Ppon9G0CtTS/c/8lNaBH1AMpQ4nPHpxyS 5crA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0CK7/XiAMhupawfrWQ+PTIpUyjnKMaKIN+EBiTWXkTI=; b=jlcX8HqcVAicJK5fZsrLK64g88j3vFqR6yytopHzh6QydymP455/63inmoiEzF1mZ4 pHPUMLm812+DhIlVO8iA3wLJcwHdmhm+soZOyE3VXzjUBFYsomN8kSzhb24c1eU+vyPK zTv/yicYgN0i21jY4nDbTjYPMOFNRWyGo6IERRiUIeSJdolgqJ2ilCVD7IKak65cmlIq 6XjmP1EN13FaYEJA71WqNi5lHtpN4PNt1rpWNZhga8jK+4AXuMN4uksJo+mvV1DUBlm3 8yeZxjfxVfAfDtW+bgKUwkx733++M00Bk26EOkVN1DJhYzFRdVPChWOKaHRWo9jtblQp 5vMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QxwJQrPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fu35-20020a170907b02300b0072b8ec116a0si3083029ejc.796.2022.07.15.07.11.17; Fri, 15 Jul 2022 07:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QxwJQrPc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234966AbiGONhP (ORCPT + 99 others); Fri, 15 Jul 2022 09:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234865AbiGONhL (ORCPT ); Fri, 15 Jul 2022 09:37:11 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A3E37CB7A for ; Fri, 15 Jul 2022 06:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0CK7/XiAMhupawfrWQ+PTIpUyjnKMaKIN+EBiTWXkTI=; b=QxwJQrPcPW70NuWTnf4RiTP9LX UDYXhDB3UkbyMMX+/LdgeOeMRAL7/POLJles7kptlaCIyrg1lm7+aAlp0AS8K9JX/dbVX+KRl2TVr clZz1P8G7OCvVrhtQBJwA62eVBKuUCBrArGlbeE78dOJhR7+rQnkdpnIqsZRcqt5isqKOG5uVoleH kc8UT8EaJpNO0aR2By51izwXeWUs17ON1796Zc8JNH/tCPh+2Of1Bsa3Er+qUqmNa3x3vhbxhbwAl EtQqBTLYAxSrRF0RZmHlGWVab9y3HD/5hvSzI9Tu1c1wGei9lsTWUGMZob02WmK5N0RmVDA1dyaQS uC5awWnA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33356) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oCLV6-00074P-Qj; Fri, 15 Jul 2022 14:37:00 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oCLV5-0007aQ-69; Fri, 15 Jul 2022 14:36:59 +0100 Date: Fri, 15 Jul 2022 14:36:59 +0100 From: "Russell King (Oracle)" To: Tetsuo Handa Cc: Marc Zyngier , Tony Lindgren , LKML , Linux ARM Subject: Re: [PATCH v2] ARM: spectre-v2: fix smp_processor_id() warning Message-ID: References: <795c9463-452e-bf64-1cc0-c318ccecb1da@I-love.SAKURA.ne.jp> <421c1ca9-f553-4c0a-d963-2fdeb270dbcc@I-love.SAKURA.ne.jp> <3188347c-3375-b728-cd08-ea4421d823cd@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3188347c-3375-b728-cd08-ea4421d823cd@I-love.SAKURA.ne.jp> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2022 at 10:09:01PM +0900, Tetsuo Handa wrote: > syzbot is reporting that CONFIG_HARDEN_BRANCH_PREDICTOR=y + > CONFIG_DEBUG_PREEMPT=y on ARM32 causes "BUG: using smp_processor_id() in > preemptible code" message [1], for this check was not designed to handle > attempts to access kernel memory like > > ---------- > int main() { return *(char *) -1; } > ---------- > > . Although Russell King commented that this BUG: message might help finding > possible exploit attempts [2], this is not a kernel's problem that worth > giving up fuzz testing. But shutting up a valid warning when the real problem is still there is also not acceptable. As I've said many times, the workaround needs to be run on the _same_ CPU that faulted. The warning is telling us that we're preemptible at this point, which means that can't be guaranteed. So bodging it by disabling preemption around here DOES NOT FIX THE PROBLEM. It _SHUTS UP THE VALID WARNING_. And shutting up a valid warning is A VERY BAD PRACTICE. NAK. MAK. NAK. NAK. NAK. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!