From: willemb@google.com
To: Juan Agustin Niccolini <juanagusnicco@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Willem de Bruijn <willemb@google.com>, Eric Garver <e@erig.me>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 0/4] udp: Fix bind conflict check bypasses
Date: Sun, 29 Nov 2026 09:39:24 -0500 [thread overview]
Message-ID: <willemb.2286e1bb9b8c2@google.com> (raw)
In-Reply-To: <20261120174341.35873-1-juanagusnicco@gmail.com>
Juan Agustin Niccolini wrote:
> An unprivileged user can get a UDP socket bound to an address and port
> that another user's socket holds, in a state bind() would have refused,
> and receive that socket's datagrams. This series fixes three bugs that
> allow that and adds a selftest.
> These are sibling vulnerabilities of the TCP one fixed by my
> commit f675070191f2 ("tcp: Fix the SO_REUSEPORT bind cache admitting a
> conflicting socket"). The one in patch 1 has the same kind of cause: a
> SO_REUSEPORT shortcut that lets one matching socket stand for every
> socket on the port. The other two predate git. All were discovered
> during an LLM-based audit.
> Juan Agustin Niccolini (4):
> udp: Fix bind conflict check stopping at the first reuseport socket
> udp: Keep the bound device on disconnect unless connect() set it
> udp: Ignore a connect()-set device in the bind conflict check
> selftests: net: Add UDP bind conflict tests
No need to fix the pre-existing issues (connect() address narrowing,
L2TP/IPv6, VRF conflict checks, or the residual ABA window), indeed.
But please respin v2 onto net for the following:
1. Drop Patch 1 and rebase Patches 2-4 onto net: commit d77700039d09
("udp: only quit inuse scan early on identical SO_REUSEPORT
sockets") already landed in net with the same fix. Please keep the
reuseport_* selftests in Patch 4 (with an updated commit message).
2. Patch 2: fix the new unlocked sk->sk_userlocks RMW race in
__udp_disconnect() for ping/raw/L2TP that Sashiko flagged (which
is a regression since __udp_disconnect() previously never wrote
sk_userlocks).
3. Patch 2: address Sashiko's note on the VRF disconnect behavior
change (at minimum move it from the "---" notes into the commit
message, or preserve/restore the pre-connect ifindex).
4. Patch 3 (while rebasing): drop the redundant udp_bound_dev_if()
calls.
-- details
- For (3), see also the parallel patch saving the pre-connect ifindex:
https://lore.kernel.org/r/20261124180603.72523-1-dmnk@google.com
- For (4), sk is being bound under lock_sock(sk), so read
sk->sk_bound_dev_if directly, and load udp_bound_dev_if(sk2) once
per candidate and pass it to udp_sk_reuseport_match().
--
pw-bot: cr
prev parent reply other threads:[~2026-11-29 14:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:43 [PATCH net 0/4] udp: Fix bind conflict check bypasses Juan Agustin Niccolini
2026-11-20 17:43 ` [PATCH net 1/4] udp: Fix bind conflict check stopping at the first reuseport socket Juan Agustin Niccolini
2026-11-20 17:43 ` [PATCH net 2/4] udp: Keep the bound device on disconnect unless connect() set it Juan Agustin Niccolini
2026-11-24 18:30 ` netdev-bot+sashiko
2026-11-24 19:43 ` Juan Agustin Niccolini
2026-11-20 17:43 ` [PATCH net 3/4] udp: Ignore a connect()-set device in the bind conflict check Juan Agustin Niccolini
2026-11-24 18:30 ` netdev-bot+sashiko
2026-11-24 19:40 ` Juan Agustin Niccolini
2026-11-20 17:43 ` [PATCH net 4/4] selftests: net: Add UDP bind conflict tests Juan Agustin Niccolini
2026-11-29 14:39 ` willemb [this message]
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=willemb.2286e1bb9b8c2@google.com \
--to=willemb@google.com \
--cc=davem@davemloft.net \
--cc=e@erig.me \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=juanagusnicco@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemdebruijn.kernel@gmail.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 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.