mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/4] udp: Fix bind conflict check bypasses
@ 2026-11-20 17:43 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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Juan Agustin Niccolini @ 2026-11-20 17:43 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, Willem de Bruijn,
	Willem de Bruijn, Eric Garver, Shuah Khan, linux-kselftest,
	netdev, linux-kernel

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


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

end of thread, other threads:[~2026-11-20 17:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-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

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®