Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2918569rwb; Mon, 15 Aug 2022 14:03:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR7cImT0/uANGCF1uh1qhVJ9TnWVt/mAR3mCeRrGtZRJjjyd2eCpOof89q/BF6aUCmTfaVXu X-Received: by 2002:a65:4c06:0:b0:429:71e4:216 with SMTP id u6-20020a654c06000000b0042971e40216mr4471895pgq.163.1660597393640; Mon, 15 Aug 2022 14:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597393; cv=none; d=google.com; s=arc-20160816; b=WBPfibuZQ8lywhllpneqr/klBGprJ+t+W+E/44jUe5jm7BL3+yveW/ESJllIqAJbH6 6ZRzq60/8/gcNDOpQkLaRhzZK8CJgVTRlUgMeVzuxzb5SYOvqmZb0qbX86gaEpcIKyLP Hm1sn/EMnwTcGO7pGbsXzCIPttN7bTgUYu88LeQnLXlogTJg4Dl5DDuWHvvQKbEX6zws TRdFbFNIPqE5temzAZEC7wvLnbuE2AQAkgYhgvNyMOsE8jQwsfZH7AQTzJ5Ea6ZqewlI zW+INuOiI48Sc6jCW0zV7RffhPIDN8xgsquQowRrxe+/BVIg7Gux3eCarbGj7lm9kuQ/ r+4A== 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=r6jkQmqaE5RxdCOBgOP9cKEi3PI05SHPBttDDtDzC9E=; b=rwyG7LrK8RLc4jUJD60W2TqM8G5qbHNTXB5KDybWNkeOmFU4Y1zHCixgXork/qexpz hpUlxRU/RnDkS5oPCGs5+MYCmpfyJDLAZHVi533O1Zka/Pv9yBv/bkTKUyBBP3341Ndy jTWbOwUfMfbcP27WZPcruIbKnUSXMv8AACzLOP9C12JpXRxUMA+N8yLAlpUTY7pA7/Fk QQCiyNEQa2pZMcUU0lXMPqzeGFwedP42EjJegsNLkkasSNIk8yYKV6wVME4jF4niSEov Umzdyssap89EGpsM2KHFGgGW31OpzaSCCN6z7HxdT6VbONvmZEAsVSewOTWi1tCex7sx ouCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="WRk/3aWf"; 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 a63-20020a639042000000b0041b698ead1asi11582610pge.794.2022.08.15.14.03.00; Mon, 15 Aug 2022 14:03:13 -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="WRk/3aWf"; 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 S1347878AbiHOUbs (ORCPT + 99 others); Mon, 15 Aug 2022 16:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347497AbiHOUZx (ORCPT ); Mon, 15 Aug 2022 16:25:53 -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 9CBDA9C2FA; Mon, 15 Aug 2022 12:03:21 -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 1D76061299; Mon, 15 Aug 2022 19:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26387C433D6; Mon, 15 Aug 2022 19:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590198; bh=8TuZYBANaANy8tBI2NDEhOSwYzvW/85ai8F71UZsmK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WRk/3aWfd19oT+8svzQTErB7sNeTlSmbjYbgcI/zylUmooPpxp7p5+U9U8e0FLP6t ktFVN6OO/WP/wQtQq+TRFzYc6LNkRw5UNVCfr67dGgvd7uubCJvatIDjoX8PrRAXho /RU1oMgPk5S8NNb0mTFNDhIhNG4nirfTlE5kBW10= 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.18 0183/1095] powerpc/64s: Disable stack variable initialisation for prom_init Date: Mon, 15 Aug 2022 19:53:02 +0200 Message-Id: <20220815180437.214375030@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 4ddd161aef32..63c384c3e6d4 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