From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, fw@strlen.de
Subject: [PATCH net 00/14] Netfilter fixes for net
Date: Tue, 24 Sep 2024 22:13:47 +0200 [thread overview]
Message-ID: <20240924201401.2712-1-pablo@netfilter.org> (raw)
Hi,
The following patchset contains Netfilter fixes for net:
Patch #1 and #2 handle an esoteric scenario: Given two tasks sending UDP
packets to one another, two packets of the same flow in each direction
handled by different CPUs that result in two conntrack objects in NEW
state, where reply packet loses race. Then, patch #3 adds a testcase for
this scenario. Series from Florian Westphal.
1) NAT engine can falsely detect a port collision if it happens to pick
up a reply packet as NEW rather than ESTABLISHED. Add extra code to
detect this and suppress port reallocation in this case.
2) To complete the clash resolution in the reply direction, extend conntrack
logic to detect clashing conntrack in the reply direction to existing entry.
3) Adds a test case.
Then, an assorted list of fixes follow:
4) Add a selftest for tproxy, from Antonio Ojea.
5) Guard ctnetlink_*_size() functions under
#if defined(CONFIG_NETFILTER_NETLINK_GLUE_CT) || defined(CONFIG_NF_CONNTRACK_EVENTS)
From Andy Shevchenko.
6) Use -m socket --transparent in iptables tproxy documentation.
From XIE Zhibang.
7) Call kfree_rcu() when releasing flowtable hooks to address race with
netlink dump path, from Phil Sutter.
8) Fix compilation warning in nf_reject with CONFIG_BRIDGE_NETFILTER=n.
From Simon Horman.
9) Guard ctnetlink_label_size() under CONFIG_NF_CONNTRACK_EVENTS which
is its only user, to address a compilation warning. From Simon Horman.
10) Use rcu-protected list iteration over basechain hooks from netlink
dump path.
11) Fix memcg for nf_tables, use GFP_KERNEL_ACCOUNT is not complete.
12) Remove old nfqueue conntrack clash resolution. Instead trying to
use same destination address consistently which requires double DNAT,
use the existing clash resolution which allows clashing packets
go through with different destination. Antonio Ojea originally
reported an issue from the postrouting chain, I proposed a fix:
https://lore.kernel.org/netfilter-devel/ZuwSwAqKgCB2a51-@calendula/T/
which he reported it did not work for him.
13) Adds a selftest for patch 12.
14) Fixes ipvs.sh selftest.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git nf-24-09-24
Thanks.
----------------------------------------------------------------
The following changes since commit 9410645520e9b820069761f3450ef6661418e279:
Merge tag 'net-next-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next (2024-09-16 06:02:27 +0200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git tags/nf-24-09-24
for you to fetch changes up to 69021d3bc01c72c3315ea541062351a623b72c8f:
selftests: netfilter: Avoid hanging ipvs.sh (2024-09-19 14:54:10 +0200)
----------------------------------------------------------------
netfilter pull request 24-09-24
----------------------------------------------------------------
Andy Shevchenko (1):
netfilter: ctnetlink: Guard possible unused functions
Antonio Ojea (1):
selftests: netfilter: nft_tproxy.sh: add tcp tests
Florian Westphal (5):
netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash
netfilter: conntrack: add clash resolution for reverse collisions
selftests: netfilter: add reverse-clash resolution test case
netfilter: nfnetlink_queue: remove old clash resolution logic
kselftest: add test for nfqueue induced conntrack race
Pablo Neira Ayuso (2):
netfilter: nf_tables: use rcu chain hook list iterator from netlink dump path
netfilter: nf_tables: missing objects with no memcg accounting
Phil Sutter (2):
netfilter: nf_tables: Keep deleted flowtable hooks until after RCU
selftests: netfilter: Avoid hanging ipvs.sh
Simon Horman (2):
netfilter: nf_reject: Fix build warning when CONFIG_BRIDGE_NETFILTER=n
netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS
谢致邦 (XIE Zhibang) (1):
docs: tproxy: ignore non-transparent sockets in iptables
Documentation/networking/tproxy.rst | 2 +-
include/linux/netfilter.h | 4 -
net/ipv4/netfilter/nf_reject_ipv4.c | 10 +-
net/ipv6/netfilter/nf_reject_ipv6.c | 5 +-
net/netfilter/nf_conntrack_core.c | 141 +++-----
net/netfilter/nf_conntrack_netlink.c | 9 +-
net/netfilter/nf_nat_core.c | 121 ++++++-
net/netfilter/nf_tables_api.c | 6 +-
net/netfilter/nft_compat.c | 6 +-
net/netfilter/nft_log.c | 2 +-
net/netfilter/nft_meta.c | 2 +-
net/netfilter/nft_numgen.c | 2 +-
net/netfilter/nft_set_pipapo.c | 13 +-
net/netfilter/nft_tunnel.c | 5 +-
tools/testing/selftests/net/netfilter/Makefile | 4 +
tools/testing/selftests/net/netfilter/config | 1 +
.../net/netfilter/conntrack_reverse_clash.c | 125 +++++++
.../net/netfilter/conntrack_reverse_clash.sh | 51 +++
tools/testing/selftests/net/netfilter/ipvs.sh | 2 +-
tools/testing/selftests/net/netfilter/nft_queue.sh | 92 +++++-
.../selftests/net/netfilter/nft_tproxy_tcp.sh | 358 +++++++++++++++++++++
.../selftests/net/netfilter/nft_tproxy_udp.sh | 262 +++++++++++++++
22 files changed, 1091 insertions(+), 132 deletions(-)
create mode 100644 tools/testing/selftests/net/netfilter/conntrack_reverse_clash.c
create mode 100755 tools/testing/selftests/net/netfilter/conntrack_reverse_clash.sh
create mode 100755 tools/testing/selftests/net/netfilter/nft_tproxy_tcp.sh
create mode 100755 tools/testing/selftests/net/netfilter/nft_tproxy_udp.sh
next reply other threads:[~2024-09-24 20:14 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 20:13 Pablo Neira Ayuso [this message]
2024-09-24 20:13 ` [PATCH net 01/14] netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 02/14] netfilter: conntrack: add clash resolution for reverse collisions Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 03/14] selftests: netfilter: add reverse-clash resolution test case Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 04/14] selftests: netfilter: nft_tproxy.sh: add tcp tests Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 05/14] netfilter: ctnetlink: Guard possible unused functions Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 06/14] docs: tproxy: ignore non-transparent sockets in iptables Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 07/14] netfilter: nf_tables: Keep deleted flowtable hooks until after RCU Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 08/14] netfilter: nf_reject: Fix build warning when CONFIG_BRIDGE_NETFILTER=n Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 09/14] netfilter: ctnetlink: compile ctnetlink_label_size with CONFIG_NF_CONNTRACK_EVENTS Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 10/14] netfilter: nf_tables: use rcu chain hook list iterator from netlink dump path Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 11/14] netfilter: nf_tables: missing objects with no memcg accounting Pablo Neira Ayuso
2024-09-24 20:13 ` [PATCH net 12/14] netfilter: nfnetlink_queue: remove old clash resolution logic Pablo Neira Ayuso
2024-09-24 20:14 ` [PATCH net 13/14] kselftest: add test for nfqueue induced conntrack race Pablo Neira Ayuso
2024-09-24 20:14 ` [PATCH net 14/14] selftests: netfilter: Avoid hanging ipvs.sh Pablo Neira Ayuso
2024-09-26 9:41 ` [PATCH net 00/14] Netfilter fixes for net Paolo Abeni
2024-09-26 10:37 ` Florian Westphal
2024-09-26 10:38 ` Pablo Neira Ayuso
2024-09-26 10:41 ` Florian Westphal
2024-09-26 10:43 ` Paolo Abeni
2024-09-26 10:56 ` Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2024-01-17 16:00 Pablo Neira Ayuso
2022-08-24 22:03 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=20240924201401.2712-1-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
/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).