From: "Daniel P. Berrangé" <firstname.lastname@example.org> To: Michael Tokarev <email@example.com> Cc: "Peter Maydell" <firstname.lastname@example.org>, qemu-stable <email@example.com>, "QEMU Developers" <firstname.lastname@example.org>, "Marc-André Lureau" <email@example.com> Subject: Re: [PATCH] qemu-sockets: fix unix socket path copy (again) Date: Wed, 1 Sep 2021 12:58:51 +0100 [thread overview] Message-ID: <YS9q+yXJzcslU92I@redhat.com> (raw) In-Reply-To: <firstname.lastname@example.org> 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 <email@example.com> 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 :|
next prev parent reply other threads:[~2021-09-01 12:14 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-31 18:26 Michael Tokarev 2021-08-31 19:21 ` Marc-André Lureau 2021-08-31 19:26 ` Michael Tokarev 2021-09-01 9:12 ` Daniel P. Berrangé 2021-09-01 9:20 ` Michael Tokarev 2021-08-31 19:47 ` Peter Maydell 2021-09-01 8:29 ` Michael Tokarev 2021-09-01 9:52 ` Peter Maydell 2021-09-01 11:45 ` Michael Tokarev 2021-09-01 11:58 ` Daniel P. Berrangé [this message] 2021-09-01 11:57 ` Daniel P. Berrangé
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YS9q+yXJzcslU92I@redhat.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH] qemu-sockets: fix unix socket path copy (again)' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.