netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 08/10] netfilter: fix xt_TEE and xt_TPROXY dependencies
Date: Wed, 11 Nov 2015 18:33:41 +0100	[thread overview]
Message-ID: <1447263223-22662-9-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1447263223-22662-1-git-send-email-pablo@netfilter.org>

From: Arnd Bergmann <arnd@arndb.de>

Kconfig is too smart for its own good: a Kconfig line that states

	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES

means that if IP6_NF_IPTABLES is set to 'm', then NF_DEFRAG_IPV6 will
also be set to 'm', regardless of the state of the symbol from which
it is selected. When the xt_TEE driver is built-in and nothing else
forces NF_DEFRAG_IPV6 to be built-in, this causes a link-time error:

net/built-in.o: In function `tee_tg6':
net/netfilter/xt_TEE.c:46: undefined reference to `nf_dup_ipv6'

This works around that behavior by changing the dependency to
'if IP6_NF_IPTABLES != n', which is interpreted as boolean expression
rather than a tristate and causes the NF_DEFRAG_IPV6 symbol to
be built-in as well.

The bug only occurs once in thousands of 'randconfig' builds and
does not really impact real users. From inspecting the other
surrounding Kconfig symbols, I am guessing that NETFILTER_XT_TARGET_TPROXY
and NETFILTER_XT_MATCH_SOCKET have the same issue. If not, this
change should still be harmless.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index e22349e..4692782 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -869,7 +869,7 @@ config NETFILTER_XT_TARGET_TEE
 	depends on IPV6 || IPV6=n
 	depends on !NF_CONNTRACK || NF_CONNTRACK
 	select NF_DUP_IPV4
-	select NF_DUP_IPV6 if IP6_NF_IPTABLES
+	select NF_DUP_IPV6 if IP6_NF_IPTABLES != n
 	---help---
 	This option adds a "TEE" target with which a packet can be cloned and
 	this clone be rerouted to another nexthop.
@@ -882,7 +882,7 @@ config NETFILTER_XT_TARGET_TPROXY
 	depends on IP6_NF_IPTABLES || IP6_NF_IPTABLES=n
 	depends on IP_NF_MANGLE
 	select NF_DEFRAG_IPV4
-	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
+	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES != n
 	help
 	  This option adds a `TPROXY' target, which is somewhat similar to
 	  REDIRECT.  It can only be used in the mangle table and is useful
@@ -1375,7 +1375,7 @@ config NETFILTER_XT_MATCH_SOCKET
 	depends on IPV6 || IPV6=n
 	depends on IP6_NF_IPTABLES || IP6_NF_IPTABLES=n
 	select NF_DEFRAG_IPV4
-	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
+	select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES != n
 	help
 	  This option adds a `socket' match, which can be used to match
 	  packets for which a TCP or UDP socket lookup finds a valid socket.
-- 
2.1.4

  parent reply	other threads:[~2015-11-11 17:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 17:33 [PATCH 00/10] Netfilter fixes for net Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 01/10] netfilter: ingress: don't use nf_hook_list_active Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 02/10] netfilter: ingress: fix wrong input interface on hook Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 03/10] netfilter: ipset: Fix extension alignment Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 04/10] netfilter: ipset: Fix hash:* type expiration Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 05/10] netfilter: ipset: Fix hash type expire: release empty hash bucket block Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 06/10] netfilter: Fix removal of GRE expectation entries created by PPTP Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 07/10] netfilter: nfnetlink_log: work around uninitialized variable warning Pablo Neira Ayuso
2015-11-11 17:33 ` Pablo Neira Ayuso [this message]
2015-11-11 17:33 ` [PATCH 09/10] net: add __netdev_alloc_pcpu_stats() to indicate gfp flags Pablo Neira Ayuso
2015-11-11 17:33 ` [PATCH 10/10] netfilter: nf_tables: add clone interface to expression operations Pablo Neira Ayuso
2015-11-12 19:20 ` [PATCH 00/10] Netfilter fixes for net David Miller
2015-11-13 17:58 ` Josh Boyer
2015-11-13 18:52   ` Jozsef Kadlecsik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447263223-22662-9-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).