From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 6/6] netfilter: conntrack: skip clash resolution if nat is in place
Date: Tue, 12 Jul 2016 18:11:02 +0200 [thread overview]
Message-ID: <1468339862-4028-7-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1468339862-4028-1-git-send-email-pablo@netfilter.org>
The clash resolution is not easy to apply if the NAT table is
registered. Even if no NAT rules are installed, the nul-binding ensures
that a unique tuple is used, thus, the packet that loses race gets a
different source port number, as described by:
http://marc.info/?l=netfilter-devel&m=146818011604484&w=2
Clash resolution with NAT is also problematic if addresses/port range
ports are used since the conntrack that wins race may describe a
different mangling that we may have earlier applied to the packet via
nf_nat_setup_info().
Fixes: 71d8c47fc653 ("netfilter: conntrack: introduce clash resolution on insertion race")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
---
net/netfilter/nf_conntrack_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 62c42e9..9f530ad 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -646,6 +646,7 @@ static int nf_ct_resolve_clash(struct net *net, struct sk_buff *skb,
l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct));
if (l4proto->allow_clash &&
+ !nfct_nat(ct) &&
!nf_ct_is_dying(ct) &&
atomic_inc_not_zero(&ct->ct_general.use)) {
nf_ct_acct_merge(ct, ctinfo, (struct nf_conn *)skb->nfct);
--
2.1.4
next prev parent reply other threads:[~2016-07-12 16:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 16:10 [PATCH 0/6] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2016-07-12 16:10 ` [PATCH 1/6] netfilter: nf_tables: fix memory leak if expr init fails Pablo Neira Ayuso
2016-07-12 16:10 ` [PATCH 2/6] netfilter: nft_meta: set skb->nf_trace appropriately Pablo Neira Ayuso
2016-07-12 16:10 ` [PATCH 3/6] netfilter: conntrack: avoid integer overflow when resizing Pablo Neira Ayuso
2016-07-12 16:11 ` [PATCH 4/6] ipvs: fix bind to link-local mcast IPv6 address in backup Pablo Neira Ayuso
2016-07-12 16:11 ` [PATCH 5/6] netfilter: nft_ct: fix expiration getter Pablo Neira Ayuso
2016-07-12 16:11 ` Pablo Neira Ayuso [this message]
2016-07-12 17:22 ` [PATCH 0/6] Netfilter/IPVS fixes for net David Miller
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=1468339862-4028-7-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).