Re: [PATCH] util: fix abstract socket path copy

2021-08-31 Thread Marc-André Lureau
Hi On Tue, Aug 31, 2021 at 2:32 PM Peter Maydell wrote: > On Tue, 31 Aug 2021 at 11:17, Michael Tokarev wrote: > > > > 31.08.2021 12:53, Peter Maydell wrote: > > > On Mon, 30 Aug 2021 at 23:30, Michael Tokarev wrote: > > >> > > >> 31.08.2021 01:06, Michael Tokarev wrote: > > >> ... > > >>> And

Re: [PATCH] util: fix abstract socket path copy

2021-08-31 Thread Peter Maydell
On Tue, 31 Aug 2021 at 11:17, Michael Tokarev wrote: > > 31.08.2021 12:53, Peter Maydell wrote: > > On Mon, 30 Aug 2021 at 23:30, Michael Tokarev wrote: > >> > >> 31.08.2021 01:06, Michael Tokarev wrote: > >> ... > >>> And this is the value used to be returned in the getsockname/getpeername > >>>

Re: [PATCH] util: fix abstract socket path copy

2021-08-31 Thread Michael Tokarev
31.08.2021 12:53, Peter Maydell wrote: On Mon, 30 Aug 2021 at 23:30, Michael Tokarev wrote: 31.08.2021 01:06, Michael Tokarev wrote: ... And this is the value used to be returned in the getsockname/getpeername calls. So this has nothing to do with socket being abstract or not. We asked for l

Re: [PATCH] util: fix abstract socket path copy

2021-08-31 Thread Peter Maydell
On Mon, 30 Aug 2021 at 23:30, Michael Tokarev wrote: > > 31.08.2021 01:06, Michael Tokarev wrote: > ... > > And this is the value used to be returned in the getsockname/getpeername > > calls. > > > > So this has nothing to do with socket being abstract or not. We asked for > > larger storage for t

Re: [PATCH] util: fix abstract socket path copy

2021-08-30 Thread Michael Tokarev
31.08.2021 01:06, Michael Tokarev wrote: ... And this is the value used to be returned in the getsockname/getpeername calls. So this has nothing to do with socket being abstract or not. We asked for larger storage for the sockaddr structure, and the kernel was able to build one for us, including

Re: [PATCH] util: fix abstract socket path copy

2021-08-30 Thread Michael Tokarev
31.08.2021 00:38, Michael Tokarev wrote: ... @@ -1345,13 +1345,16 @@ socket_sockaddr_to_address_unix(struct sockaddr_storage *sa,   SocketAddress *addr;   struct sockaddr_un *su = (struct sockaddr_un *)sa; +    assert(salen >= sizeof(su->sun_family) + 1 && +   salen <= sizeof(str

Re: [PATCH] util: fix abstract socket path copy

2021-08-30 Thread Michael Tokarev
19.07.2021 16:01, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket support" neglected to update socket_sockaddr_to_address_unix() and copied the whole sun_path without taking "salen" into account. Later, commit 3b14b4ec

Re: [PATCH] util: fix abstract socket path copy

2021-08-04 Thread Markus Armbruster
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > support" neglected to update socket_sockaddr_to_address_unix() and > copied the whole sun_path without taking "salen" into account. > > Later, commit 3b14b4ec49 "so

Re: [PATCH] util: fix abstract socket path copy

2021-08-04 Thread Marc-André Lureau
Hi On Wed, Aug 4, 2021 at 12:39 PM Markus Armbruster wrote: > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > > support" neglected to update socket_sockaddr_to_address_unix() and > > copied the whole su

Re: [PATCH] util: fix abstract socket path copy

2021-07-19 Thread zhao xiao qiang
在 2021/7/19 21:01, marcandre.lur...@redhat.com 写道: > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > support" neglected to update socket_sockaddr_to_address_unix() and > copied the whole sun_path without taking "salen" into account. > > Later, commit 3b14b4ec49 "sockets: Fix s

Re: [PATCH] util: fix abstract socket path copy

2021-07-19 Thread Marc-André Lureau
On Mon, Jul 19, 2021 at 5:49 PM Daniel P. Berrangé wrote: > On Mon, Jul 19, 2021 at 05:01:12PM +0400, marcandre.lur...@redhat.com > wrote: > > From: Marc-André Lureau > > > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > > support" neglected to update socket_sockaddr_to_addr

Re: [PATCH] util: fix abstract socket path copy

2021-07-19 Thread Daniel P . Berrangé
On Mon, Jul 19, 2021 at 05:01:12PM +0400, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket > support" neglected to update socket_sockaddr_to_address_unix() and > copied the whole sun_path without taking "salen" into

[PATCH] util: fix abstract socket path copy

2021-07-19 Thread marcandre . lureau
From: Marc-André Lureau Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket support" neglected to update socket_sockaddr_to_address_unix() and copied the whole sun_path without taking "salen" into account. Later, commit 3b14b4ec49 "sockets: Fix socket_sockaddr_to_address_unix() for