Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2873869rwb; Mon, 15 Aug 2022 13:04:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR7j7RzGq77XxugYzVAn2jhreDA9giPk0YymGx7qvEtJyjVlBwyFmuDPST5bMSFoGNfwZbDF X-Received: by 2002:a17:90b:1943:b0:1f7:b63e:60db with SMTP id nk3-20020a17090b194300b001f7b63e60dbmr29821309pjb.241.1660593871229; Mon, 15 Aug 2022 13:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660593871; cv=none; d=google.com; s=arc-20160816; b=dJdWl+gqFbOQmkASYxpI17M5h1DqnjhROyTnmECvuDLSPwuw45kT3ZjqmpN5Ql6H3b yhjmPYALTV/a8DP+GYBAzNTSCNSD0mM8RvasoCrTJzD9jxjLIXMKNycHCyVDi2ZIZXwl n6MHgRYjo2lPF7tvFGvHC+XwSwaHB3q88GHp1RG7fw8rI1beDvqiT5Rz7nROPqRX/9ai dOFj3RXZRe1ZiCLK0VxMmcPV9A93u9bvCsKVuj6URCGJXWh6x7Dr0N5gSpF5Cbv19IbW V7XLwn/6AawUujkkWEY0OSIezQNPrdWQovyamS2jDzMKLtPauTSu9bCrTnHuRoBLQeYY XTPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QypPB9VCs889hIKzxKQgwreh/ju0KH8UkefRdbtQmts=; b=uwqBgE7mLy2fYLa1i1hIgsXV62xKnThfwiC1FLtGv36aA+fUCmlZEuc9I1dn4TH0Le 1GcHCR0YABs0xG4ZFvz3r1mH33OnrKqaMCIMTsIUJd2HJ0/Ch5Cyiwt4OWCm+D5GscF/ 8El++0me8LCehyNeFX74pq2eONrg4oKuax7hVFmtOpA6msza6l3XOk+tP2FWQkpk3ad1 0dMOFwGJHF4cj/2wI206jkG1OtvZL5sW9z9Y0IX/3EOKDTgYm17aPr7aASaqz35qY19e JxwY87+S6dXWBSfXB1kVvcfuSPtnTPztntn/eMhetDzYHZD5NLQDcINVF3Sd3YCPcdy/ 6t8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p+F1Fuhm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my6-20020a17090b4c8600b001f20c50d659si13989830pjb.116.2022.08.15.13.04.19; Mon, 15 Aug 2022 13:04:31 -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=pass header.i=@linuxfoundation.org header.s=korg header.b=p+F1Fuhm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243121AbiHOSb5 (ORCPT + 99 others); Mon, 15 Aug 2022 14:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243360AbiHOSa6 (ORCPT ); Mon, 15 Aug 2022 14:30:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2843326DD; Mon, 15 Aug 2022 11:20:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2292660EBB; Mon, 15 Aug 2022 18:20:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2785FC433C1; Mon, 15 Aug 2022 18:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587657; bh=ai9n7In6AvAmJCXp8dgLUdN/R33ZQxYkQ1xdEtuRzyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+F1Fuhm/fJTHMZTq9GhjLziD/CUAFsRdado6P1qgTeqJPNlWD+WktccTOyIBnHnT b7sJl+5K5vEDBNeNtDjhNPXaE/Qs0+pUniFAD6TdwqZuJCaONthIQyzNTP2LNLCFGw a+W8gvhYxa3y3YD+Rx2rexokXPxl7XeM1hX+UjSE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudip Mukherjee , Michael Ellerman , Sasha Levin Subject: [PATCH 5.15 152/779] powerpc/64s: Disable stack variable initialisation for prom_init Date: Mon, 15 Aug 2022 19:56:36 +0200 Message-Id: <20220815180343.809087800@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Michael Ellerman [ Upstream commit be640317a1d0b9cf42fedb2debc2887a7cfa38de ] With GCC 12 allmodconfig prom_init fails to build: Error: External symbol 'memset' referenced from prom_init.c make[2]: *** [arch/powerpc/kernel/Makefile:204: arch/powerpc/kernel/prom_init_check] Error 1 The allmodconfig build enables KASAN, so all calls to memset in prom_init should be converted to __memset by the #ifdefs in asm/string.h, because prom_init must use the non-KASAN instrumented versions. The build failure happens because there's a call to memset that hasn't been caught by the pre-processor and converted to __memset. Typically that's because it's a memset generated by the compiler itself, and that is the case here. With GCC 12, allmodconfig enables CONFIG_INIT_STACK_ALL_PATTERN, which causes the compiler to emit memset calls to initialise on-stack variables with a pattern. Because prom_init is non-user-facing boot-time only code, as a workaround just disable stack variable initialisation to unbreak the build. Reported-by: Sudip Mukherjee Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220718134418.354114-1-mpe@ellerman.id.au Signed-off-by: Sasha Levin --- arch/powerpc/kernel/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index b1b23b4d56ba..ed91d5b9ffc6 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -20,6 +20,7 @@ CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) CFLAGS_prom_init.o += -fno-stack-protector CFLAGS_prom_init.o += -DDISABLE_BRANCH_PROFILING CFLAGS_prom_init.o += -ffreestanding +CFLAGS_prom_init.o += $(call cc-option, -ftrivial-auto-var-init=uninitialized) ifdef CONFIG_FUNCTION_TRACER # Do not trace early boot code -- 2.35.1