Skip to content

inet: Fixes for inet_csk_get_port and soreusport

Tom Herbert netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2inet: Don't go into port scan when looking for specific bind portnet/ipv4/inet_connection_sock.c+1 -10 replies
2/2inet: Fix get port to handle zero port number with soreuseport setinclude/net/inet6_connection_sock.h include/net/inet_connection_sock.h net/ipv4/inet_connection_sock.c +1 more+19 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] inet: Fixes for inet_csk_get_port and soreusport

This patch set fixes a couple of issues I noticed while debugging our softlockup issue in inet_csk_get_port.

- Don't allow jump into port scan in inet_csk_get_port if function was called with non-zero port number (looking up explicit port number).
- When inet_csk_get_port is called with zero port number (ie. perform scan) an reuseport is set on the socket, don't match sockets that also have reuseport set. The intent from the user should be to get a new port number and then explictly bind other sockets to that number using soreuseport.

Tested:

Ran first patch on production workload with no ill effect.

For second patch, ran a little listener application and first demonstrated that unbound sockets with soreuseport can indeed be bound to unrelated soreuseport sockets.

Tom Herbert (2):
inet: Don't go into port scan when looking for specific bind port
inet: Fix get port to handle zero port number with soreuseport set

 include/net/inet6_connection_sock.h |  3 ++-
 include/net/inet_connection_sock.h  |  6 ++++--
 net/ipv4/inet_connection_sock.c     | 16 ++++++++++------
 net/ipv6/inet6_connection_sock.c    |  7 ++++---
 4 files changed, 20 insertions(+), 12 deletions(-)
Signature · 1 line
2.9.3