]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: snat: evict closing tcp entries on reply tuple collision
authorFlorian Westphal <fw@strlen.de>
Tue, 6 Jun 2023 20:59:30 +0000 (22:59 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 26 Jun 2023 06:05:57 +0000 (08:05 +0200)
commit4589725502871e77d06464f731f92fd9173e2be6
tree42c398c71f40803b81430cb7d490f1e1a88b1771
parent96b2ef9b16cb302d0b47c5670d30a05963e0e1e3
netfilter: snat: evict closing tcp entries on reply tuple collision

When all tried source tuples are in use, the connection request (skb)
and the new conntrack will be dropped in nf_confirm() due to the
non-recoverable clash.

Make it so that the last 32 attempts are allowed to evict a colliding
entry if this connection is already closing and the new sequence number
has advanced past the old one.

Such "all tuples taken" secenario can happen with tcp-rpc workloads where
same dst:dport gets queried repeatedly.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_nat_core.c