netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC net 0/2] Fix race between datagram socket address change and rehash
@ 2024-11-14 21:54 Stefano Brivio
  2024-11-14 21:54 ` [PATCH RFC net 1/2] datagram: Rehash sockets only if local address changed for their family Stefano Brivio
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Stefano Brivio @ 2024-11-14 21:54 UTC (permalink / raw)
  To: Willem de Bruijn, Eric Dumazet
  Cc: netdev, Mike Manning, David Gibson, Ed Santiago, Paul Holzinger

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(-)

-- 
2.40.1


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

end of thread, other threads:[~2024-11-19 14:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 21:54 [PATCH RFC net 0/2] Fix race between datagram socket address change and rehash Stefano Brivio
2024-11-14 21:54 ` [PATCH RFC net 1/2] datagram: Rehash sockets only if local address changed for their family Stefano Brivio
2024-11-15 17:48   ` Willem de Bruijn
2024-11-15 18:10     ` Stefano Brivio
2024-11-15 18:23       ` Stefano Brivio
2024-11-19 12:33         ` Stefano Brivio
2024-11-19 14:54           ` Willem de Bruijn
2024-11-14 21:54 ` [PATCH RFC net 2/2] datagram, udp: Set local address and rehash socket atomically against lookup Stefano Brivio
2024-11-15 17:50   ` Willem de Bruijn
2024-11-15 18:10     ` Stefano Brivio
2024-11-15 19:55   ` Kuniyuki Iwashima
2024-11-19 12:33     ` Stefano Brivio
2024-11-15  3:01 ` [PATCH RFC net 0/2] Fix race between datagram socket address change and rehash David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).