Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14545626rwb; Mon, 28 Nov 2022 02:17:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6N+vyyejdktdsUNZoz7wApkzkcXU8awu1wFbldpXKXqzzua2BqWc1aPw9TzBDO7mnHtWwb X-Received: by 2002:a17:906:404:b0:781:f54c:1947 with SMTP id d4-20020a170906040400b00781f54c1947mr30057387eja.69.1669630655844; Mon, 28 Nov 2022 02:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669630655; cv=none; d=google.com; s=arc-20160816; b=noqc9TrNyM/Is9BxIHNq16YeSoBE7ufFmC63J8RQxBd0A+7IiV3zASLTTL3Hm7CLpQ trxNh0jUjUlPoQbry6Hu03I3TwvF/hIRH2wC/Cfvm0gq40eUINGy4Av5bL0GZzvl8SGP kKRKN6snysKWGCiiKgoba1dR70eIdgvNRQIKqU8an8nG2xv+A2fvvF69IC5aBEh4xRQ5 1ZiWw65i24WF+3tBbt6s/7L38sZ+ahziH0T3LsSEm2kq+2vC7yjlgeueZCTEBclT2Wbe qnuCB1/RlvbMsDKaOIbz/Rbiogp7+dVXQMs7NjiMoppXzGQgB0OJuddyTxMpXnDuGU2M I5dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=EbGZKS+qvK8GyN2QoDUmiRi72+7r6EA+WhM7BEXgEt8=; b=hQK1ABhU+dLcVdLv38/uMJnD4BkR36TfrWKyVc1TfvUlAGHFdArYEu0NwsgxAyd2sm ViPZdW9dcrOqCflgKBDPlLHpRRt4hLTOqNFmizotyEQ18v3jG3jmvzLWU/cejSkIUwHP FZ72Nk309H3UYVsSeXg9JSOGPJCiGErSc0cdDotODAV275rFi+yA2lrSlZIKELrCX9cm HgvgdWzhC3Z0UzlpPBMQN/4eWr4M48Y7uPvuCt9HpmZNnbZmtf64LKDkopv0CBBy6Oue 8u+GWA6viRNjDUNDgC+Dx7mJj8vAopqvvsZB8MWdyYmlEwIhSpcnX1VgLtl7gWm9wdYC JUBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xh2-20020a170906da8200b007826cb6f57csi8698356ejb.407.2022.11.28.02.17.14; Mon, 28 Nov 2022 02:17:35 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbiK1KAh (ORCPT + 85 others); Mon, 28 Nov 2022 05:00:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiK1KAf (ORCPT ); Mon, 28 Nov 2022 05:00:35 -0500 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 67A80193EA; Mon, 28 Nov 2022 02:00:34 -0800 (PST) Date: Mon, 28 Nov 2022 11:00:31 +0100 From: Pablo Neira Ayuso To: Ivan Babrou Cc: Daniel Xu , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Unused variable 'mark' in v6.1-rc7 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 Hi, On Sun, Nov 27, 2022 at 05:30:47PM -0800, Ivan Babrou wrote: > There's 52d1aa8b8249 in v6.1-rc7: > > * netfilter: conntrack: Fix data-races around ct mark > > It triggers an error: > > #19 355.8 /build/linux-source/net/netfilter/nf_conntrack_netlink.c: In > function '__ctnetlink_glue_build': > #19 355.8 /build/linux-source/net/netfilter/nf_conntrack_netlink.c:2674:13: > error: unused variable 'mark' [-Werror=unused-variable] > #19 355.8 2674 | u32 mark; > #19 355.8 | ^~~~ > #19 355.8 cc1: all warnings being treated as errors > > If CONFIG_NF_CONNTRACK_MARK is not enabled, as mark is declared > unconditionally, but used under ifdef: > > #ifdef CONFIG_NF_CONNTRACK_MARK > - if ((events & (1 << IPCT_MARK) || ct->mark) > - && ctnetlink_dump_mark(skb, ct) < 0) > + mark = READ_ONCE(ct->mark); > + if ((events & (1 << IPCT_MARK) || mark) && > + ctnetlink_dump_mark(skb, mark) < 0) > goto nla_put_failure; > #endif > > To have NF_CONNTRACK_MARK one needs NETFILTER_ADVANCED: > > config NF_CONNTRACK_MARK > bool 'Connection mark tracking support' > depends on NETFILTER_ADVANCED > > It's supposed to be enabled by default: > > config NETFILTER_ADVANCED > bool "Advanced netfilter configuration" > depends on NETFILTER > default y > > But it's not in defconfig (it's missing from arm64 completely): > > $ rg NETFILTER_ADVANCED arch/x86/configs/x86_64_defconfig > 93:# CONFIG_NETFILTER_ADVANCED is not set > > I think the solution is to enclose mark definition into ifdef as well > and I'm happy to send a patch if you agree and would like me to. Thanks for reporting and offering a patch: Could you give a try to this one? I'll be glad to get a Tested-by: tag if this is correct to you. https://patchwork.ozlabs.org/project/netfilter-devel/patch/20221128095853.10589-1-pablo@netfilter.org/ Thanks.