mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juan Agustin Niccolini <juanagusnicco@gmail.com>
To: "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: [PATCH net 0/4] udp: Fix bind conflict check bypasses
Date: Fri, 20 Nov 2026 12:43:37 -0500	[thread overview]
Message-ID: <20261120174341.35873-1-juanagusnicco@gmail.com> (raw)

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

 include/net/sock.h                            |   4 +
 net/core/sock.c                               |   3 +
 net/ipv4/udp.c                                |  69 +++++-
 net/ipv6/datagram.c                           |  25 +-
 tools/testing/selftests/net/.gitignore        |   1 +
 tools/testing/selftests/net/Makefile          |   1 +
 .../testing/selftests/net/udp_bind_conflict.c | 228 ++++++++++++++++++
 7 files changed, 317 insertions(+), 14 deletions(-)


base-commit: 19a227903e65c7a9c179156485660a4e017575fe
-- 
2.43.0


             reply	other threads:[~2026-11-20 17:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 17:43 Juan Agustin Niccolini [this message]
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-20 17:43 ` [PATCH net 3/4] udp: Ignore a connect()-set device in the bind conflict check Juan Agustin Niccolini
2026-11-20 17:43 ` [PATCH net 4/4] selftests: net: Add UDP bind conflict tests Juan Agustin Niccolini

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=20261120174341.35873-1-juanagusnicco@gmail.com \
    --to=juanagusnicco@gmail.com \
    --cc=davem@davemloft.net \
    --cc=e@erig.me \
    --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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    --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 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®