Skip to content

RFC Fix race between datagram socket address change and rehash

Stefano Brivio llvm netdev oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2datagram: Rehash sockets only if local address changed for their familynet/ipv4/datagram.c net/ipv6/datagram.c+2 -25 replies
2/2datagram, udp: Set local address and rehash socket atomically against lookupinclude/net/sock.h include/net/udp.h net/core/sock.c +8 more+108 -484 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchDavid Gibson
1/2
2/2Analysed-by

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

Read the v1 thread

Cover letter [PATCH RFC net 0/2] Fix race between datagram socket address change and rehash

Patch 2/2 fixes a race condition in the lookup of datagram sockets between address change (triggered by connect()) and rehashing.

Patch 1/2 is a small optimisation to simplify 2/2.

Stefano Brivio (2):
datagram: Rehash sockets only if local address changed for their
family
datagram, udp: Set local address and rehash socket atomically against
lookup

 include/net/sock.h  |  2 +-
 include/net/udp.h   |  3 +-
 net/core/sock.c     | 13 ++++++--
 net/ipv4/datagram.c |  7 +++--
 net/ipv4/udp.c      | 76 +++++++++++++++++++++++++++++++--------------
 net/ipv4/udp_impl.h |  2 +-
 net/ipv4/udplite.c  |  2 +-
 net/ipv6/datagram.c | 30 +++++++++++++-----
 net/ipv6/udp.c      | 17 ++++++----
 net/ipv6/udp_impl.h |  2 +-
 net/ipv6/udplite.c  |  2 +-
 11 files changed, 108 insertions(+), 48 deletions(-)
Signature · 1 line
2.40.1