[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-28 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> fixed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-28 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset dae09c2b819c2683ad870733451c050b59c3eb93 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) 
(GH-32140) (GH-32156)
https://github.com/python/cpython/commit/dae09c2b819c2683ad870733451c050b59c3eb93


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-28 Thread miss-islington


miss-islington  added the comment:


New changeset 5944807b09717d43bb017f700e8c451dd07199ed by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866) 
(GH-32140)
https://github.com/python/cpython/commit/5944807b09717d43bb017f700e8c451dd07199ed


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30236
pull_request: https://github.com/python/cpython/pull/32156

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread ty


Change by ty :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30223
pull_request: https://github.com/python/cpython/pull/32141

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +30222
pull_request: https://github.com/python/cpython/pull/32140

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-27 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset f6b3a07b7df60dc04d0260169ffef6e9796a2124 by ty in branch 'main':
bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
https://github.com/python/cpython/commit/f6b3a07b7df60dc04d0260169ffef6e9796a2124


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

Actually the OS will always trust the length has already contained the last NUL.

The test I did in this issue: https://github.com/rust-lang/rust/issues/69061 
showed that:

1. OS trusted the input length was set correctly, both `sun_len` and the length 
of `struct sockaddr_un`.
2. The `struct sockaddr_un` and length will be copied without changed to the 
other programs.
3. It could be reproduced by the Rust dev team. So it shouldn't be a problem in 
the testcase itself.

Maybe we could discuss this on the Github's PR page? I am very sure that it 
could be reproduced.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

It looks like the length would be short by one in Python before this change, 
meaning binding or connecting to a non-anonymous named AF_UNIX socket 
potentially loses the last character of the path name intended to be bound? 
Depending on if the OS uses the length or trusts a null termination?

That should be an observable behavior change.

It also suggests that fixing this could break code that has been working around 
this bug forever by adding an extra character when binding or connecting to a 
non-anonymous AF_UNIX socket?  Is that true?  In what circumstances is this 
practically observed?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Bug filing tip for ty/zonyitoo: Describe the problem in the text when filing 
the bug. Include its consequences and how it is observed in practice.

A bug filed just saying "look at this code, this is wrong" does not communicate 
a need for anyone to spend time on an issue or help others find an existing 
issue describing misbehavior they may be seeing.

--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not the socket programming expert. It just happened that I fixed some bugs 
here. But according to the manpage 
https://man7.org/linux/man-pages/man7/unix.7.html the address length should 
include the terminating NUL: offsetof(struct sockaddr_un, sun_path) + 
strlen(sun_path) + 1. So the fix is correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Christian Heimes


Christian Heimes  added the comment:

We have a dedicated team of volunteers that triage incoming tickets. They 
assign tickets and ping experts. It looks like nobody triaged your submissions 
because nobody understood it. Your ticket did not contain an explanation and 
the link now goes to an unrelated line in the code.

That is the reason I asked you to provide detailed information on the ticket. 
We have over 7,000 open tickets and over 1,600 open PRs. Your issue got lost in 
the noise.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

Oh, it should also occurs on Linux, I should correct that.

--
nosy:  -christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

More about the tests:

The error will only shows on BSD systems, for example macOS.

Here are some tests done with C and Rust:

https://github.com/rust-lang/rust/issues/69061

If both the servers and clients are written in Python, you won't notice this 
bug because the original code ignored the length of sockaddr_un and use the 
sun_path as a C string (NUL terminated string).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

Sorry Heimes. I just don't know who is responsible for this code, which is very 
very old.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread Christian Heimes


Christian Heimes  added the comment:

Antoine, Serhiy, please take a look. You are the last developers that touched 
the AF_UNIX socket path code.

Ty, why are you pinging me on this issue or on the PR? I'm neither familiar 
with that code nor responsible for it.

--
components: +Extension Modules -Library (Lib)
nosy: +pitrou, serhiy.storchaka
type: behavior -> resource usage
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

Ping Heimes.

This is a huge bug that exists for a very long time, please consider merge it 
and fix it in the next relesae.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-24 Thread ty


ty  added the comment:

I think I have already provided enough information about this bug.

The `len_ret` was the length of `sockaddr_un`, which should include the 
terminated NUL in the `sun_path`. But the original implementation only use  
`path.len + offsetof(struct sockaddr_un, sun_path)`.

References:

1. https://man7.org/linux/man-pages/man7/unix.7.html  The Address format 
section.

2. The `SUN_LEN` macro in *BSD systems, https://man.cx/unix(4)

--
versions:  -Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2022-03-23 Thread Aaron Gallagher


Aaron Gallagher <_...@habnab.it> added the comment:

sigh.. adding myself to nosy here too in the hope that this gets any traction

--
nosy: +habnabit

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-09-26 Thread Ned Deily


Change by Ned Deily :


--
resolution: fixed -> 
versions: +Python 3.11 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-08-22 Thread ty


ty  added the comment:

Hello and PING.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-07-25 Thread ty


ty  added the comment:

Changes have been made in this PR, waiting for reviewing.

--
resolution:  -> fixed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-06-22 Thread ty


Change by ty :


--
keywords: +patch
pull_requests: +25441
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26866

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44493] Missing terminated NUL in the length of sockaddr_un

2021-06-22 Thread ty


New submission from ty :

https://github.com/python/cpython/blob/main/Modules/socketmodule.c#L1700

--
components: Library (Lib)
messages: 396379
nosy: zonyitoo
priority: normal
severity: normal
status: open
title: Missing terminated NUL in the length of sockaddr_un
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com