All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 0/3] netfilter: conntrack: clash resolution for reverse collisions
@ 2024-09-10  9:38 Florian Westphal
  2024-09-10  9:38 ` [PATCH nf-next 1/3] netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash Florian Westphal
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Florian Westphal @ 2024-09-10  9:38 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

This series resolves an esoteric scenario.

Given two tasks sending UDP packets to one another, NAT engine
can falsely detect a port collision if it happens to pick up
a reply packet as 'new' rather than 'reply'.

First patch adds extra code to detect this and suppress port
reallocation in this case.

Second patch extends clash resolution logic to detect such
a reverse clash (clashing conntrack is reply to existing entry).

Patch 3 adds a test case.

Since this has existed forever and hasn't been reported in two
decades I'm submitting this for -next.

Florian Westphal (3):
  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

 net/netfilter/nf_conntrack_core.c             |  56 +++++++-
 net/netfilter/nf_nat_core.c                   | 120 ++++++++++++++++-
 .../testing/selftests/net/netfilter/Makefile  |   2 +
 .../net/netfilter/conntrack_reverse_clash.c   | 125 ++++++++++++++++++
 .../net/netfilter/conntrack_reverse_clash.sh  |  51 +++++++
 5 files changed, 347 insertions(+), 7 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

-- 
2.44.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-16  8:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10  9:38 [PATCH nf-next 0/3] netfilter: conntrack: clash resolution for reverse collisions Florian Westphal
2024-09-10  9:38 ` [PATCH nf-next 1/3] netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash Florian Westphal
2024-09-10  9:38 ` [PATCH nf-next 2/3] netfilter: conntrack: add clash resolution for reverse collisions Florian Westphal
2024-09-10  9:38 ` [PATCH nf-next 3/3] selftests: netfilter: add reverse-clash resolution test case Florian Westphal
2024-09-15 21:11 ` [PATCH nf-next 0/3] netfilter: conntrack: clash resolution for reverse collisions Pablo Neira Ayuso
2024-09-16  8:38   ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.