You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
Using getsockname() or getpeername() on UNIX domain sockets crashes Graphene.
Steps to reproduce
Create a UNIX domain socket with, e.g., socket() or socketpair(), and call getsockname() or getpeername() on the socket.
(A particular situation where this problem occurs is if a UNIX socket object is printed in Python, but this bug is not Python-specific in any way and is reproducible also with C code.)
Tested with Graphene 75962a8 (current master branch).
Expected results
The expected result is that the functions would work also with UNIX domain sockets, ideally perhaps with similar results as Linux produces for different types of UNIX sockets.
Actual results
debug: DkProcessExit: Returning exit code 1 is printed and Graphene exits.
Currently it seems that regardless of the socket type, both shim_do_getsockname() and shim_do_getpeername() call inet_copy_addr(), which seems intended only for AF_INET/AF_INET6 addresses and aborts if given (e.g.) an AF_UNIX socket.
The text was updated successfully, but these errors were encountered:
Currently it seems that regardless of the socket type, both shim_do_getsockname() and shim_do_getpeername() call inet_copy_addr(), which seems intended only for AF_INET/AF_INET6 addresses and aborts if given (e.g.) an AF_UNIX socket.
Yes, I'm pretty sure your analysis is correct. Hopefully we'll find some time soon to fix this bug.
Description of the problem
Using
getsockname()
orgetpeername()
on UNIX domain sockets crashes Graphene.Steps to reproduce
Create a UNIX domain socket with, e.g.,
socket()
orsocketpair()
, and callgetsockname()
orgetpeername()
on the socket.(A particular situation where this problem occurs is if a UNIX socket object is printed in Python, but this bug is not Python-specific in any way and is reproducible also with C code.)
Tested with Graphene 75962a8 (current master branch).
Expected results
The expected result is that the functions would work also with UNIX domain sockets, ideally perhaps with similar results as Linux produces for different types of UNIX sockets.
Actual results
debug: DkProcessExit: Returning exit code 1
is printed and Graphene exits.Currently it seems that regardless of the socket type, both
shim_do_getsockname()
andshim_do_getpeername()
callinet_copy_addr()
, which seems intended only for AF_INET/AF_INET6 addresses and aborts if given (e.g.) an AF_UNIX socket.The text was updated successfully, but these errors were encountered: