From: Dmitry Antipov <dmantipov@xxxxxxxxx> Date: Wed, 31 Jul 2024 10:05:37 +0300 > > What happens if two sockets matching each other reach here ? > > Not sure. If two sockets reach the reuseport_alloc() path, two identical reuseport groups are created. Then, in __sctp_rcv_lookup_endpoint(), incoming packets hit only one socket group placed before the other in the hash bucket, and the other socket no longer receive data and silently died from userspace POV. The suggested change papers over the problem. reusport_add_sock() and reuseport_alloc() must be placed in the same writer critical section. > In general, an attempt to use rather external thing (struct > sctp_hashbucket) to implement extra synchronization for reuse innards > looks somewhat weird. reuseport_lock is to synchronise operations within the same reuseport group, but which socket should belong to which group is out of scope. That must be well-defined and synchronised at the upper level. I'll post v2 with updated changelog. Thanks!