Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6147156iog; Thu, 23 Jun 2022 12:19:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vLWv6mEvMcxvh3i1MFmdfIrGgEISPjhCCXtn83GXfrV014nbrtn8IgwtyGPPRHIkXoboqb X-Received: by 2002:a17:902:f543:b0:16a:54c6:78c0 with SMTP id h3-20020a170902f54300b0016a54c678c0mr6327497plf.22.1656011946100; Thu, 23 Jun 2022 12:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011946; cv=none; d=google.com; s=arc-20160816; b=G+GKqXxxMX1mYbi79LZQBGnvLv9wjVXl6jia9zNSm3xflhsbz5fi4Mhpjyer8beSTl SBTmoyqjfanK1DFdXOusv0ujG+e3iJa2vMVe5Zjrgdg33t9okMrQWyxM3SxH4r1EdeWk /DPcMvHpJql9L4ZkedNH+tlDQU08DN9OItbcSHEXoSHWdPKIhV7ecbVrmq5AvPPylyoG eE1u+UntwoolnCWBbu7tyBOXWNipyki6yWAL08721+sGCX5I3G2iKjYKeiFdktk6W2++ RWAlEgWNKHIfqAtJOVrB8rvqOQkaymh4tnAeFUrLNnzy32oV6ETTp6MhkTce7+xykjjz TFiQ== 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=H1yRkwv1MEZWhwgmjE2BWPmNkijaSzjVkse3fKFghTw=; b=xcUCaDSKIK8qlpnIk7cHfLox4M0kFh5zeomq8y5kp+EppdaZNOm70sdtnVbUKinibE dXe2PcWljOY7vQR/jCdDfQKNxAw7ofOkkdm2MV9mz8QSWEBRurAbrVl3ZGinTMDC7etE dLVxgnEt8C/gtmKf7glwAhp+1JAp20MZIc0+NbxqgPk4E9Fd38byFjDKqgt9lSScBJKc u8mLT0KeKm9+PNKHfok64/MUEAnIPT1+FlYWDt/P5SJBgeQFCQL+b/roHzcyj+xfMe8k qsPTMs/zAP4uYwEJ7/zQze0REY/2ppc80O7TyAPn/Z5e64YfUJ9xZjsGNVYgN4EB7O2h i4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fOlfPgjU; 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 g14-20020a63e60e000000b003fb23692294si5960986pgh.218.2022.06.23.12.18.54; Thu, 23 Jun 2022 12:19: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=pass header.i=@linuxfoundation.org header.s=korg header.b=fOlfPgjU; 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 S235606AbiFWR4h (ORCPT + 99 others); Thu, 23 Jun 2022 13:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235797AbiFWRxT (ORCPT ); Thu, 23 Jun 2022 13:53:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908A756C29; Thu, 23 Jun 2022 10:14:04 -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 ams.source.kernel.org (Postfix) with ESMTPS id 29B96B824B4; Thu, 23 Jun 2022 17:14:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89935C341C5; Thu, 23 Jun 2022 17:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656004441; bh=IW/Y7Ddet1fSzLjYzGoLll2KroEs14D2GhKt3VnyfSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fOlfPgjUQZBYV9jwfDyu4jba1cRJquE2ao5owDxnT3+l/eDHaR3ub4gm3pa2ea4le CyZPYD3YkLkpkn8YTr5+34PEHlt9pVKTYySGANFb0WeMH6NdjC2Brf/tdxt3pdNe1v 5qtCx5gWNzvXpfv4viiPtB5e5cPsB72OoyGa+/PM= 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.19 008/234] latent_entropy: avoid build error when plugin cflags are not set Date: Thu, 23 Jun 2022 18:41:15 +0200 Message-Id: <20220623164343.290153153@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@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 @@ -20,7 +20,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,