udp: Fix bind conflict check bypasses
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | udp: Fix bind conflict check stopping at the first reuseport socketnet/ | +16 | 0 replies | |
| 2/4 | udp: Keep the bound device on disconnect unless connect() set itinclude/ net/ net/ +1 more | +29 | 0 replies | |
| 3/4 | udp: Ignore a connect()-set device in the bind conflict checknet/ net/ net/ | +48 | 0 replies | |
| 4/4 | selftests: net: Add UDP bind conflict teststools/ tools/ tools/ | +230 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH net 0/4] udp: Fix bind conflict check bypasses
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
Signature · 1 line
2.43.0