After spending some time I think I have narrowed down the bug fix to
Linux kernel 5.10-rc6.

The bug reproed on Ubuntu with kernel 5.10-rc4 but not on 5.10-rc6.

Here is a diff of the kernel sources between those two versions:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/?id=v5.10-rc6&id2=v5.10-rc4&dt=2

Of note are some changes to `net/ipv4/inet_hashtables.c`

Using `git blame` I think the most likely source of the bug fix was this
commit by Ricardo Dias:
https://github.com/torvalds/linux/commit/01770a166165738a6e05c3d911fb4609cc4eb416

The description for the commit describes a race condition which looks
like it could cause the bug:

"When such event happens, the TCP stack code has a race condition that
occurs between the momement a lookup is done to the established
connections hashtable to check for the existence of a connection for the
same client, and the moment that the child socket is added to the
established connections hashtable. As a consequence, this race condition
can lead to a situation where we add two child sockets to the
established connections hashtable and deliver two sockets to the
userspace program to the same client."

So for anyone who comes across this bug, the likely solution is to
update your OS to a version which uses kernel 5.10 or greater.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1924298

Title:
  accept returns duplicate endpoints under load

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1924298/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to