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

2021-05-22 Thread Kyle Stanley
Kyle Stanley added the comment: > Thanks, Ned <3 (For following up and closing the issue) -- ___ Python tracker ___ ___

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

2021-05-22 Thread Kyle Stanley
Kyle Stanley added the comment: > Since 3.5 has now reached end-of-life, this issue will not be fixed there so > it looks like it can be closed. Thanks, Ned <3 -- ___ Python tracker

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

2021-05-21 Thread Ned Deily
Ned Deily added the comment: Since 3.5 has now reached end-of-life, this issue will not be fixed there so it looks like it can be closed. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5 ___

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

2020-02-25 Thread Łukasz Langa
Łukasz Langa added the comment: Downgrading priority since it's released everywhere except for 3.5. -- priority: deferred blocker -> normal ___ Python tracker ___

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

2019-12-16 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for taking care of merging the remaining backport PRs for 3.6-3.8, Ned. Now, the only branch left is (potentially) 3.5. -- ___ Python tracker

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

2019-12-16 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17101 pull_request: https://github.com/python/cpython/pull/17632 ___ Python tracker ___

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

2019-12-16 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17099 pull_request: https://github.com/python/cpython/pull/17630 ___ Python tracker ___

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

2019-12-16 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17100 pull_request: https://github.com/python/cpython/pull/17631 ___ Python tracker ___

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

2019-12-13 Thread Kyle Stanley
Kyle Stanley added the comment: Opened a PR that adds the whatsnew entries to master, 3.8, 3.7, and 3.6: GH-17595. -- ___ Python tracker ___

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

2019-12-13 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17067 pull_request: https://github.com/python/cpython/pull/17595 ___ Python tracker ___

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

2019-12-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +17055 pull_request: https://github.com/python/cpython/pull/17581 ___ Python tracker ___

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

2019-12-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +17054 pull_request: https://github.com/python/cpython/pull/17580 ___ Python tracker ___

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

2019-12-12 Thread miss-islington
Change by miss-islington : -- pull_requests: +17053 pull_request: https://github.com/python/cpython/pull/17579 ___ Python tracker ___

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

2019-12-11 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17051 pull_request: https://github.com/python/cpython/pull/17577 ___ Python tracker ___

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

2019-12-11 Thread Kyle Stanley
Kyle Stanley added the comment: > One more resource warning about unclosed resource being garbage collected. As > per the other tests I think transport and protocol need to be closed as per > below patch but someone can verify if it's the right approach. Ah, good catch. It's not needed when

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

2019-12-11 Thread Kyle Stanley
Kyle Stanley added the comment: > I'll fix them accordingly and open a new PR (as well as the backports). Nevermind. Upon further inspection, the other occurrences of `reuse_address=` were for create_server(), not create_datagram_endpoint(). The PR will only include the removal of the two

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

2019-12-11 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-12-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: One more resource warning about unclosed resource being garbage collected. As per the other tests I think transport and protocol need to be closed as per below patch but someone can verify if it's the right approach. ./python.exe -X tracemalloc

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

2019-12-11 Thread Kyle Stanley
Kyle Stanley added the comment: > or left an outdated test somewhere that explicitly sets `reuse_address=False` Looks like this was the issue, I left a `reuse_address=False` in both test_create_datagram_endpoint_nosoreuseport and test_create_datagram_endpoint_ip_addr. I fixed it locally on

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

2019-12-11 Thread Kyle Stanley
Kyle Stanley added the comment: > The fix seems to generate few DeprecationWarning while running test suite > with -Wall. Thanks Karthikeyan, I'm guessing that I missed an assertWarns() or left an outdated test somewhere that explicitly sets `reuse_address=False` (since

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

2019-12-11 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The fix seems to generate few DeprecationWarning while running test suite with -Wall. ➜ cpython git:(master) git checkout ab513a38c98695f271e448fe2cb7c5e39eef~1 Lib/asyncio Updated 1 path from 4fb4056fbc ➜ cpython git:(master) ✗ ./python.exe

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

2019-12-10 Thread Kyle Stanley
Kyle Stanley added the comment: Now that the backports for 3.6-3.8 are merged, I'll work on the What's New entries next. Waiting on feedback from Larry Hastings regarding the potential 3.5 backport, I'll add him to the nosy list. -- nosy: +larry

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

2019-12-10 Thread Ned Deily
Ned Deily added the comment: New changeset b23c0840ce07e03f2705fb08d94f8f03e5c5d5b8 by Ned Deily (Kyle Stanley) in branch '3.6': [3.6] bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311). (GH-17571)

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

2019-12-10 Thread Kyle Stanley
Change by Kyle Stanley : -- pull_requests: +17045 pull_request: https://github.com/python/cpython/pull/17571 ___ Python tracker ___

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

2019-12-10 Thread Kyle Stanley
Kyle Stanley added the comment: Oh okay, I'll work on the 3.6 backport first then. -- ___ Python tracker ___ ___ Python-bugs-list

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

2019-12-10 Thread Ned Deily
Ned Deily added the comment: Actually, 3.6.10rc1 is currently blocked by this so if you do have time to work on it first, that would be great. -- ___ Python tracker ___

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

2019-12-10 Thread Kyle Stanley
Kyle Stanley added the comment: > since the release for 3.7.1 and 3.7.6 are coming up soon. Clarification: should be "since the release for 3.8.1 and 3.7.6 are coming up soon", that was a typo. -- ___ Python tracker

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

2019-12-10 Thread Kyle Stanley
Kyle Stanley added the comment: > The backport to 3.7 seems straightforward so I did it to unblock 3.7.6rc1. > The backport to 3.6 is a bit more complicated and 3.6.10rc1 can wait a bit > longer so I'll leave that for Kyle along with the various What's New entries. Thanks, Ned. I'll

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

2019-12-10 Thread Ned Deily
Ned Deily added the comment: The backport to 3.7 seems straightforward so I did it to unblock 3.7.6rc1. The backport to 3.6 is a bit more complicated and 3.6.10rc1 can wait a bit longer so I'll leave that for Kyle along with the various What's New entries. --

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

2019-12-10 Thread Ned Deily
Ned Deily added the comment: New changeset 95157c6a281ccfc7a92a17dfb8d7b5338cad5cb7 by Ned Deily in branch '3.7': bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311) (GH-17570) https://github.com/python/cpython/commit/95157c6a281ccfc7a92a17dfb8d7b5338cad5cb7

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

2019-12-10 Thread Ned Deily
Change by Ned Deily : -- pull_requests: +17044 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17570 ___ Python tracker ___

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

2019-12-09 Thread Kyle Stanley
Kyle Stanley added the comment: Thanks for taking care of merging to 3.x (master) and 3.8, Łukasz! > Kyle, I'm releasing 3.8.1rc1 now. Please add the What's New entry before next > Monday (3.8.1). No problem, I'll definitely have time to do that before 3.8.1 final, likely in the next few

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

2019-12-09 Thread Łukasz Langa
Łukasz Langa added the comment: Kyle, I'm releasing 3.8.1rc1 now. Please add the What's New entry before next Monday (3.8.1). -- stage: patch review -> ___ Python tracker

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

2019-12-09 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 79c29742a8ba96fc933efe34e55e90537b3eb780 by Łukasz Langa (Miss Islington (bot)) in branch '3.8': bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311) (#17529)

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

2019-12-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +17007 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17529 ___ Python tracker ___

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

2019-12-09 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset ab513a38c98695f271e448fe2cb7c5e39eef by Łukasz Langa (Kyle Stanley) in branch 'master': bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (#17311)

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

2019-12-07 Thread Kyle Stanley
Kyle Stanley added the comment: > Where are we with this? The deadline for 3.8.1 and 3.7.6 is coming up in a > few days. I believe we're just waiting on review and additional feedback on GH-17311, which implements Antoine's proposal. The only remaining component I can think of is the

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

2019-12-07 Thread Ned Deily
Ned Deily added the comment: Where are we with this? The deadline for 3.8.1 and 3.7.6 is coming up in a few days. -- ___ Python tracker ___

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

2019-11-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: I support Antoine's proposal. Let's remove the suspicious option if we cannot handle it correctly in a secured manner. If people still want to use SO_REUSEADDR they can apply it manually, old good transp.get_extra_info("socket") is still available.

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

2019-11-22 Thread Kyle Stanley
Kyle Stanley added the comment: > This was reported by a partner that was working porting our code to Android > but might be fixed current Android API levels. I cannot test this myself. Thanks, it's helpful to be aware of potential incompatibilities either way. I don't think we directly

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

2019-11-22 Thread Jukka Väisänen
Jukka Väisänen added the comment: > Are you aware of what currently supported platforms have SO_REUSEPORT defined > where the *reuse_port* parameter doesn't actually work? This would be quite > helpful to know. This was reported by a partner that was working porting our code to Android but

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

2019-11-21 Thread Kyle Stanley
Kyle Stanley added the comment: > some platforms apparently do have SO_REUSEPORT defined but the option still > doesn't work, resulting in a ValueError exception from > create_datagram_endpoint(). Are you aware of what currently supported platforms have SO_REUSEPORT defined where the

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

2019-11-21 Thread Jukka Väisänen
Jukka Väisänen added the comment: > A higher-level interface like asyncio doesn't necessarily want to map its > kwargs directly to non-portable low-level options like this. Also reuse_port has portability issues, the whole portability mess i s nicely summed up in:

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

2019-11-21 Thread Kyle Stanley
Kyle Stanley added the comment: > I was assuming we'd only do this on Linux, since that's where the bug is... > though now that you mention it the Windows behavior is probably wonky too. Yeah, but I'm not confident that the bug is exclusive to Linux. From what I've seen, it's a fairly

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

2019-11-21 Thread Nathaniel Smith
Nathaniel Smith added the comment: I was assuming we'd only do this on Linux, since that's where the bug is... though now that you mention it the Windows behavior is probably wonky too. SO_REUSEADDR and SO_REUSEPORT have different semantics on all three of Windows/BSD/Linux. A higher-level

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

2019-11-21 Thread Kyle Stanley
Kyle Stanley added the comment: So after trying a few different implementations, I don't think the proposal to simply change `SO_REUSEADDR` -> `SO_REUSEPORT` will work, due to Windows incompatibility (based on the results from Azure Pipelines). `SO_REUSEADDR` is supported on Windows, but

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

2019-11-20 Thread Guido van Rossum
Guido van Rossum added the comment: (Don't wait for me, I am preoccupied with other things this week.) -- title: UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port -> UDP sockets created by create_datagram_endpoint() allow by

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

2019-11-20 Thread Yury Selivanov
Yury Selivanov added the comment: > Oh in that case, would you like me to close or modify GH-17311? I didn't > think you'd approve of making the more extensive changes all the way back to > 3.5. After reading the comments here I think Antoine's solution makes sense. But... let's wait a bit

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

2019-11-20 Thread Kyle Stanley
Change by Kyle Stanley : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > Yeah, I like this prposal; we can apply this to all Python's from 3.5 to 3.8. > With a proper documentation update this should be OK. Oh in that case, would you like me to close or modify GH-17311? I didn't think you'd approve of making the more extensive

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

2019-11-20 Thread Kyle Stanley
Change by Kyle Stanley : -- keywords: +patch pull_requests: +16799 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17311 ___ Python tracker ___

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

2019-11-20 Thread Yury Selivanov
Yury Selivanov added the comment: > My preference for create_datagram_endpoint() would be: > - make the "reuse_address" parameter a no-op, and raise an error when > "reuse_address=True" is passed > - do that in 3.8 as well Yeah, I like this prposal; we can apply this to all Python's from

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

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > My preference for create_datagram_endpoint() would be: > - make the "reuse_address" parameter a no-op, and raise an error when > "reuse_address=True" is passed > - do that in 3.8 as well This solution would more elegant, but my concern is that it will

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

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > I'd like to point out that it is also documented completely wrong up to this > point in time and thus people who chose True are most likely to be unaware of > the actual consequences. A user's explicit choice based on misinformation is > not really

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

2019-11-20 Thread Ned Deily
Ned Deily added the comment: (Provisionally marking this as a security-related deferred blocker issue for backporting) -- nosy: +ned.deily priority: normal -> deferred blocker type: behavior -> security versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8

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

2019-11-20 Thread Jukka Väisänen
Jukka Väisänen added the comment: > We just chose an unfortunate default for one of them I'd like to point out that it is also documented completely wrong up to this point in time and thus people who chose True are most likely to be unaware of the actual consequences. A user's explicit

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

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > There are some platforms (Linux pre-3.9 kernels) that don't have > SO_REUSEPORT. I wish I could say I don't care about such platforms; alas, I > just had to compile Python 3.7 on a system running a 2.6 kernel last month at > a client site. Based on

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

2019-11-20 Thread David Cuthbert
David Cuthbert added the comment: On the completely deprecate reuse_address and rewrite/force folks to use reuse_port proposals, I'm a bit dubious of this approach. Right now, we have two knobs that directly correspond to (potential) kernel-level socket parameters, SO_REUSEADDR and

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

2019-11-20 Thread David Cuthbert
David Cuthbert added the comment: Jukka -- Fair enough; will reword this a bit. I'm trying to keep the DeprecationWarning short enough so people's eyes don't glaze over; will see what wordsmithing I can do here. (Once you get beyond a certain length, the number of folks who actually read

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

2019-11-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: (previous message deleted, I hadn't noticed the "reuse_port" parameter) My preference for create_datagram_endpoint() would be: - make the "reuse_address" parameter a no-op, and raise an error when "reuse_address=True" is passed - do that in 3.8 as well

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

2019-11-20 Thread Antoine Pitrou
Change by Antoine Pitrou : -- Removed message: https://bugs.python.org/msg357067 ___ Python tracker ___ ___ Python-bugs-list

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

2019-11-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is another suggestion: - make the "reuse_address" parameter a no-op, and raise an error when "reuse_address=True" is passed - add a new "allow_multiple_bind=False" parameter that enables SO_REUSEPORT - do that in 3.8 as well This way we 1) solve the

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

2019-11-20 Thread Jukka Väisänen
Jukka Väisänen added the comment: Going to SO_REUSEPORT will fix the security issue and emitting a deprecation warning for default value invocation will catch the eyes of some maintainers but it will not prevent what caused me to catch this issue in the first place - starting two processes

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

2019-11-20 Thread Kyle Stanley
Kyle Stanley added the comment: > 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

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

2019-11-20 Thread Nathaniel Smith
Nathaniel Smith 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.

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

2019-11-20 Thread Jukka Väisänen
Jukka Väisänen added the comment: David, in terms of documentation changes and the emitted deprecation warning itself, I think it would be appropriate to instruct that please set the parameter explicitly to True or False to silence the warning AND point out that setting it to True has

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

2019-11-20 Thread David Cuthbert
David Cuthbert added the comment: Alright -- my first stab at the DeprecationWarning in 3.6. https://github.com/dacut/cpython/commit/6a1e261678975e2c70ec6b5e98e8affa28702312 Please critique away, and don't fret about bruising my ego. :-) Is there a more idiomatic way of getting a warning to

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

2019-11-19 Thread David Cuthbert
David Cuthbert added the comment: FreeBSD 12.1 and MacOS 10.15.1 (Catalina) appear to have saner and safer behavior. Both require the use of SO_REUSEPORT for this behavior to happen as well. FreeBSD also requires the UID to be the same or 0 for subsequent processes to make the bind() call.

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

2019-11-19 Thread David Cuthbert
David Cuthbert added the comment: I'm working on patches for the deprecation bits (targeting 3.6 for now; will work my way up from there) for review, including documentation. Unless someone tells me to stop. :-) In an attempt to make this not-so-Linux-specific, I'm reviewing how this works

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

2019-11-19 Thread Jukka Väisänen
Jukka Väisänen added the comment: I had a quick search through github for calls to create_datagram_endpoint() and the reuse_address is either not set or set explicitly to True, probably due to the error in the documentation. Only in one case (of my admittedly small sample) did it seem like

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

2019-11-18 Thread David Cuthbert
David Cuthbert added the comment: How much harm would there be in bringing the DeprecationWarning into the next patch of existing (3.6, 3.7, 3.8) releases? The security implications are significant enough that I'd want to be notified of it in my software ASAP. Users can (and should!)

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

2019-11-18 Thread Nathaniel Smith
Nathaniel Smith added the comment: Ouch, that's nasty. It also has security implications. For example, suppose you have a multi-user computer, where one user is has a video call going, which transfers packets over UDP. Another user could check what port they're using, bind to the same port,

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

2019-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: I agree that this is a bad default (and whoever wrote it, probably me, didn't know what this does for UDP). I think the right solution is to change the default, not to introduce a new method. Maybe we can deprecate the default somehow? There currently is

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

2019-11-18 Thread Jukka Väisänen
Jukka Väisänen added the comment: Sure, I fully appreciate implications of changing default behaviour and will post on python-dev. -- ___ Python tracker ___

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

2019-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: I'd be -1 on changing the default of an existing method, at least without consulting with a wider audience. We can add a new method to the loop and deprecate create_datagram_endpoint. I suggest to post to python-dev and discuss this before making any

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

2019-11-18 Thread Jukka Väisänen
Jukka Väisänen added the comment: I definitely propose changing the default for UDP sockets. Having multiple processes binding to a the same port and load-balancing incoming UDP traffic intentionally is a rare scenario which should be supported but not the default. For TCP the default is

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

2019-11-18 Thread Andrew Svetlov
Andrew Svetlov added the comment: I see two proposals: 1. Change the default for reuse_address flag 2. Document existing behavior as dangerous. What is the suggestion? Pick one, please :) -- ___ Python tracker

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

2019-11-18 Thread Jukka Väisänen
Jukka Väisänen added the comment: Can we still consider this for 3.9? I still think this is an easy way to accidentally blow your foot off with something that will probably only show up in production. -- versions: +Python 3.9 -Python 3.7 ___

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

2019-06-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: There is no chance to change the flag for 3.7. But we can consider it for 3.8 Yuri, what do you think? -- ___ Python tracker ___

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

2019-06-11 Thread Jukka Väisänen
New submission from Jukka Väisänen : When using loop.create_datagram_endpoint(), the default for reuse_address=True, which sets the SO_REUSEADDR sockopt for the UDP socket. This is a dangerous and unreasonable default for UDP, because in Linux it allows multiple processes to create listening