From: Florin Badita-Nistor <baditaflorin@gmail.com>
To: netdev@vger.kernel.org
Cc: edumazet@kernel.org, ncardwell@google.com, kuniyu@google.com,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, shuah@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: [PATCH net-next v2 0/2] tcp: fix false exhaustion of odd-sized bind port ranges
Date: Fri, 6 Nov 2026 19:14:40 +0200 [thread overview]
Message-ID: <20261106171442.31811-1-baditaflorin@gmail.com> (raw)
Fix false bind() exhaustion when an odd-sized local port range still
contains an eligible free port. The wrap can flip parity in odd-sized
ranges; even-sized scan sequences are unchanged. The namespace-wide
connect() allocator is not changed by this series.
Earlier x86-64 KVM validation of this unchanged allocator/test code:
- Regression test: four failures before, zero after (eight cases).
- Full port-range suite: four failures before, zero after (80 cases);
two existing SCTP XPASS results unchanged.
- Go net.Listen, 100 attempts per IP version: 100 failures before,
zero after; explicit free-port controls succeed in both kernels.
Changes in v2:
- Target net-next and drop the stable Cc, as requested by Eric.
- Document parity changes on odd wraps and scope the fix to bind().
- Shorten the cover letter.
v1: https://lore.kernel.org/netdev/CADnh+D0zSzAyYCLo5cXU56o9X-P3RG3N2ix7ARPrP95d8sBXmg@mail.gmail.com/
Florin Badita-Nistor (2):
tcp: avoid false bind exhaustion with odd-sized port ranges
selftests/net: cover odd-sized local port ranges with one free port
net/ipv4/inet_connection_sock.c | 2 -
.../selftests/net/ip_local_port_range.c | 67 ++++++++++++++++++-
2 files changed, 64 insertions(+), 5 deletions(-)
base-commit: bb67589c87249c9bc2415ab11a754d6e303774e3
--
2.51.0
next reply other threads:[~2026-11-06 17:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 17:14 Florin Badita-Nistor [this message]
2026-11-06 17:14 ` [PATCH net-next v2 1/2] tcp: avoid false bind exhaustion with odd-sized " Florin Badita-Nistor
2026-11-06 17:14 ` [PATCH net-next v2 2/2] selftests/net: cover odd-sized local port ranges with one free port Florin Badita-Nistor
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=20261106171442.31811-1-baditaflorin@gmail.com \
--to=baditaflorin@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@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
all inboxes | Powered by JetHome®