Skip to content

tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket

Juan Agustin Niccolini linux-kselftest lkml netdev stable 2 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 6 repliesApplied 2/2
  2. v11 patch 1 replySuperseded

Changes in v2 from the cover letter

- Shorten the changelog (Eric Dumazet)
- Add reproducer as selftest (Eric Dumazet)
v1: https://lore.kernel.org/all/[email protected]/

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socketinclude/net/inet_hashtables.h net/ipv4/inet_connection_sock.c+14 -33 repliesApplied
2/2selftests: net: Add SO_REUSEPORT bind cache test to bind_wildcard.ctools/testing/selftests/net/bind_wildcard.c+54 -02 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchKuniyuki IwashimaEric Dumazet
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net v2 0/2] tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket

The SO_REUSEPORT bind cache (tb->fast_*) can let a socket skip a bind conflict check that it would fail, so an unprivileged user can bind and listen on a port that another user is listening on.

Patch 1 fixes it. Patch 2 adds the reproducer as a selftest.

v2:
- Shorten the changelog (Eric Dumazet)
- Add reproducer as selftest (Eric Dumazet)
v1: https://lore.kernel.org/all/[email protected]/

Juan Agustin Niccolini (2):
tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket
selftests: net: Add SO_REUSEPORT bind cache test to bind_wildcard.c

 include/net/inet_hashtables.h               |  2 +
 net/ipv4/inet_connection_sock.c             | 15 ++++--
 tools/testing/selftests/net/bind_wildcard.c | 54 +++++++++++++++++++++
 3 files changed, 68 insertions(+), 3 deletions(-)

base-commit: 19a227903e65c7a9c179156485660a4e017575fe

Signature · 1 line
2.43.0