Closed llly closed 3 years ago
@llly So just replacing https://github.com/oscarlab/graphene/blob/20156c6e23ea6570614197a97daf77dcd764153b/LibOS/shim/src/sys/shim_socket.c#L468
with if (addrlen > sizeof(struct sockaddr_un))
should work?
Yes. I think so.
Description of the problem
Graphene
shim_do_bind
function return EINVAL for "addrlen is wrong" whenaddrlen
is not same assizeof(struct sockaddr_un)
, which is 110. https://github.com/oscarlab/graphene/blob/20156c6e23ea6570614197a97daf77dcd764153b/LibOS/shim/src/sys/shim_socket.c#L467-L469 But smaller size can work on Linux.Steps to reproduce
Copy example from
man bind
and changeto
Compile and create Graphene manifest.
Expected results
App with and without Graphene both can run without error.
Actual results
App without Graphene can run without error. App with Graphene returns
bind: Invalid argument
.Additional information
Bind Unix socket using Python can work on Linux, but fails with Graphene. https://hg.python.org/cpython/file/3.6/Modules/socketmodule.c#l2700
addrlen
is calculated at https://hg.python.org/cpython/file/3.6/Modules/socketmodule.c#l1581