qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] qemu-sockets: fix unix socket path copy (again)


From: Michael Tokarev
Subject: Re: [PATCH] qemu-sockets: fix unix socket path copy (again)
Date: Tue, 31 Aug 2021 22:26:00 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

31.08.2021 22:21, Marc-André Lureau wrote:
...

Seems right to me, however there are some notes in libc bits/socket.h
/* Structure large enough to hold any socket address (with the historical
    exception of AF_UNIX).  */

And also this
https://idea.popcount.org/2019-12-06-addressing/#fn:sockaddr_storage 
<https://idea.popcount.org/2019-12-06-addressing/#fn:sockaddr_storage>

I must say I feel confused by those comments :) Is it large enough or not??

It was my first thought too when I first saw the prototype
of this very function we're patching here:

  socket_sockaddr_to_address_unix(struct sockaddr_storage *sa, ...)

it uses sockaddr_storage and I swear I always thought sockaddr_storage
is for sockaddr_in and sockaddr_in6 but NOT for sockaddr_un.

If this is the case we're in trouble actually and all this stuff
needs serious review.

However by fact sockaddr_storage is actually LARGER than sockaddr_un.
I dunno how universal it is.

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]