From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH nf 0/3] netfilter: nat: fix ancient dnat+edemux bug
Date: Wed, 24 Feb 2021 17:23:18 +0100 [thread overview]
Message-ID: <20210224162321.4899-1-fw@strlen.de> (raw)
Netfilter NAT collision handling + TCP edemux can cause packets to end
up with the wrong socket.
This happens since TCP early demux was added more than 8 years ago, so
this needs very rare and specific conditions to trigger.
Patch 1 fixes the bug.
Patch 2 rewords a debug message that imlies packets are treated
as invalid while they are not.
Patch 3 adds a test case for this. On unpatched kernel this script
should error out with:
(UNKNOWN) [10.96.0.1] 443 (https) : Connection timed out
FAIL: nc cannot connect via NAT'd address
Florian Westphal (3):
netfilter: nf_nat: undo erroneous tcp edemux lookup
netfilter: conntrack: avoid misleading 'invalid' in log message
selftests: netfilter: test nat port clash resolution interaction with
tcp early demux
net/netfilter/nf_conntrack_proto_tcp.c | 6 +-
net/netfilter/nf_nat_proto.c | 25 ++++-
tools/testing/selftests/netfilter/Makefile | 2 +-
.../selftests/netfilter/nf_nat_edemux.sh | 99 +++++++++++++++++++
4 files changed, 125 insertions(+), 7 deletions(-)
create mode 100755 tools/testing/selftests/netfilter/nf_nat_edemux.sh
--
2.26.2
next reply other threads:[~2021-02-24 16:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 16:23 Florian Westphal [this message]
2021-02-24 16:23 ` [PATCH nf 1/3] netfilter: nf_nat: undo erroneous tcp edemux lookup Florian Westphal
2021-02-24 16:23 ` [PATCH nf 2/3] netfilter: conntrack: avoid misleading 'invalid' in log message Florian Westphal
2021-02-24 16:23 ` [PATCH nf 3/3] selftests: netfilter: test nat port clash resolution interaction with tcp early demux Florian Westphal
2021-02-27 21:33 ` [PATCH nf 0/3] netfilter: nat: fix ancient dnat+edemux bug Pablo Neira Ayuso
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=20210224162321.4899-1-fw@strlen.de \
--to=fw@strlen.de \
--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).