qemu-devel
[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: Daniel P . Berrangé
Subject: Re: [PATCH] qemu-sockets: fix unix socket path copy (again)
Date: Wed, 1 Sep 2021 12:58:51 +0100
User-agent: Mutt/2.0.7 (2021-05-04)

On Wed, Sep 01, 2021 at 02:45:55PM +0300, Michael Tokarev wrote:
> On 01.09.2021 12:52, Peter Maydell wrote:
> > On Wed, 1 Sept 2021 at 09:29, Michael Tokarev <mjt@tls.msk.ru> wrote:
> ...
> > > We have sizeof(sockaddr_storage) space there. If the kernel returned
> > > salen greather than that, this means we received only partial address
> > > and can't rely on it. It is like snprintf() returning more bytes than
> > > available in the buffer - it says how much bytes NEEDED.
> > 
> > I think that if we need to check that we should be checking that
> > at the point where we make the accept() or whatever other call
> > filled in the sockaddr. That is the point at which the code
> > either (a) knows that the buffer is guaranteed big enough and
> > can assert that if it likes or (b) may have some reasonable way
> > to deal with the failure, eg allocate a bigger buffer and retry,
> > and (c) it is also the point where the code knows how big the actual
> > buffer it passed to the kernel is and so can validly determine if
> > it was truncated.
> 
> I don't care where it is done, as long as what is done does not
> break in real-life scenario.
> 
> Originally I asked another question: WHY we ask for the socket name
> in the first place, why do we need it, where do we use it?

We report the address information in the monitor in several places.
We also use the address information when running SASL auth in VNC.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

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