Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6108903iog; Thu, 23 Jun 2022 11:30:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoILpB+QzZZMDZxOaQ2bYnH2KMegCXHp3mfr44P0v52h4Lhfb9jzrX/tZYqwAJVxyixcBa X-Received: by 2002:a05:6402:e07:b0:435:daf0:c8cb with SMTP id h7-20020a0564020e0700b00435daf0c8cbmr3751915edh.396.1656009023986; Thu, 23 Jun 2022 11:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656009023; cv=none; d=google.com; s=arc-20160816; b=YQr6s1zDD7jfrp2517143aPOkjSOC+ZU4osQX0su4HP0eD0xS3Ij6siPPkC2gVR4FP 7gZabgT8Qfgy3SngrVWNLa9o6zyAfJyvTc6gENKRrrL4k0kTgvQJV9HZMt3lB0D87PNU GEcqRdVIn/OWqk01LDY3tFd456Cz2BtDhbpw5IwIfvMJkorupUkjg3zWLlQTbC53Ak3b CZdBzDtP+Dykaiydu4clCUsDF/NkFayb87zlkw5NmBYmT8ll1YPU+y0LRTVQR9XMaBH3 v7Hzvai9MMlkx9ux9xOapivXq+FxRanb4B3Jy0qHBA+KOMARFuZegVrPe1dwbcSl26GK YGFQ== 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=h2KzKAmlPCunMEgLcaMeOkkAx28hJQOMuywYNB6q2/s=; b=J9AyUDELApgaP9+nWydK25wFkMo7l6JsYWsfYU69MgAxgKbysWuy3fXmeRbPvC0GCw X2LgLJBhHvRQwaufXyfUfc849P7Z4DNzf/vS8+QjggtJhXTSKo7kItKXnrYC2EIytPAw mgk3+9qQNpE7YbkH+obh9acYmFZmPbpAB24uV3nsfvf4IFVA3OTQXHUpmHZPUoUQ6pPM /ErqkeHAOjqEC1C+t17yQyfErCeqJ/b+FtDjcDM9JA3HElDVO1j8ffpWKLHQtPp7Xyfx 1kK+zoUmJjkK9VFsQ1QKZys6k+mntLOfJBcDJvPJJwVjdgiTxNyQTRDadVA6yJA0I3IL 4yTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="hQ/zWJSk"; 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 ht14-20020a170907608e00b006ff1420d58dsi10737396ejc.136.2022.06.23.11.29.58; Thu, 23 Jun 2022 11:30:23 -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="hQ/zWJSk"; 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 S233600AbiFWQ57 (ORCPT + 99 others); Thu, 23 Jun 2022 12:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbiFWQvJ (ORCPT ); Thu, 23 Jun 2022 12:51:09 -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 53FD04FC49; Thu, 23 Jun 2022 09:49:10 -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 C994061FB7; Thu, 23 Jun 2022 16:49:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87C5AC3411B; Thu, 23 Jun 2022 16:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656002949; bh=yUGzKlDdcycEqmL5SvdhoX2CxEaVgDuGj2xj4o60zxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hQ/zWJSk+EGgsFztzjqqyWAkn9nRmVeuv5qejZj1216jPfvstWkuD+oj4uqCuxG30 +UET1L84es5EDREl8+oMpEIi9cg3mu80DzRB2a2euokIwORO7JYirlmgRTCAqK0GYC MuXsa73Zlv4fcRMrHyxIT4KaBEf4Vsw2vpHUzrXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Gorbik , Kees Cook , Martin Schwidefsky , "Jason A. Donenfeld" Subject: [PATCH 4.9 042/264] latent_entropy: avoid build error when plugin cflags are not set Date: Thu, 23 Jun 2022 18:40:35 +0200 Message-Id: <20220623164345.259538189@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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: Vasily Gorbik commit 7e756f423af808b6571fed3144747db2ef7fa1c5 upstream. Some architectures set up CFLAGS for linux decompressor phase from scratch and do not include GCC_PLUGINS_CFLAGS. Since "latent_entropy" variable declaration is generated by the plugin code itself including linux/random.h in decompressor code then would cause a build error. E.g. on s390: In file included from ./include/linux/net.h:22, from ./include/linux/skbuff.h:29, from ./include/linux/if_ether.h:23, from ./arch/s390/include/asm/diag.h:12, from arch/s390/boot/startup.c:8: ./include/linux/random.h: In function 'add_latent_entropy': ./include/linux/random.h:26:39: error: 'latent_entropy' undeclared (first use in this function); did you mean 'add_latent_entropy'? 26 | add_device_randomness((const void *)&latent_entropy, | ^~~~~~~~~~~~~~ | add_latent_entropy ./include/linux/random.h:26:39: note: each undeclared identifier is reported only once for each function it appears in The build error is triggered by commit a80313ff91ab ("s390/kernel: introduce .dma sections") which made it into 5.2 merge window. To address that avoid using CONFIG_GCC_PLUGIN_LATENT_ENTROPY in favour of LATENT_ENTROPY_PLUGIN definition which is defined as a part of gcc plugins cflags and hence reflect more accurately when gcc plugin is active. Besides that it is also used for similar purpose in linux/compiler-gcc.h for latent_entropy attribute definition. Signed-off-by: Vasily Gorbik Acked-by: Kees Cook Signed-off-by: Martin Schwidefsky Signed-off-by: Jason A. Donenfeld Signed-off-by: Greg Kroah-Hartman --- include/linux/random.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/random.h +++ b/include/linux/random.h @@ -19,7 +19,7 @@ struct random_ready_callback { extern void add_device_randomness(const void *, unsigned int); -#if defined(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) && !defined(__CHECKER__) +#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__) static inline void add_latent_entropy(void) { add_device_randomness((const void *)&latent_entropy,