[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

Nathaniel Smith report at bugs.python.org
Wed Nov 20 04:21:02 EST 2019


Nathaniel Smith <njs at pobox.com> added the comment:

> Now your updated docs and warning read more like we are working around a Linux security bug which is not really the case - this behavior was intentionally added to the kernels and some of the code I do for a living relies on it to work properly. Admittedly the restriction of having the same UID wouldn't hurt.

I think you can use SO_REUSEPORT instead, and for UDP sockets it's identical to SO_REUSEADDR except with the same-UID restriction added?

If that's right then it might make sense to unconditionally switch SO_REUSEADDR -> SO_REUSEPORT, even in existing Python releases – on the theory that it fixes the main security hole, while being back-compatible enough to be acceptable for a point release.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37228>
_______________________________________


More information about the Python-bugs-list mailing list