[libvirt] [PATCH] Fix libvirtd crash in qemuDomainGetTLSObjects

ashish mittal ashmit602 at gmail.com
Wed Sep 20 11:24:18 UTC 2017


On Wed, Sep 20, 2017 at 12:52 AM, Erik Skultety <eskultet at redhat.com> wrote:

> On Wed, Sep 20, 2017 at 09:03:18AM +0200, Erik Skultety wrote:
> > On Tue, Sep 19, 2017 at 09:58:34PM -0700, Ashish Mittal wrote:
> > > Passing a NULL value for the argument secAlias to the function
> > > qemuDomainGetTLSObjects causes a segmentation fault.
> > >
> > > Thread 3 "libvirtd" received signal SIGSEGV, Segmentation fault.
> > > 0x00007f97c9c42a3d in qemuDomainGetTLSObjects (...,secAlias=0x0)
> > > at qemu/qemu_hotplug.c:1736
> >
> > Can you provide the whole backtrace? Because from what I see in the code,
> > qemuDomainGetTLSObjects is called from qemu_hotplug.c and
> qemu_migration.c, but
> > none of the code paths would result in qemuDomainGetTLSObjects to get
> secAlias
> > == NULL, solely because all the callers (direct or indirect) of this
> method call
>
> Oh, I see, this is supposed to be a follow-up patch to
> https://www.redhat.com/archives/libvir-list/2017-September/msg00645.html.
> You can disregard my comment above then, the fix still needs to be adjusted
> though as pointed out in my previous response.
>
> Erik
>
>
Thanks for pointing out my blunder! I just realized that I had not
restarted libvirtd service after running "make install" when I tested my
change. The changes appeared to work because I had the original fix
described in
https://www.redhat.com/archives/libvir-list/2017-September/msg00638.html
still in libvirtd.

I will repost after fixing and testing again.

Ashish

> it as &secAlias. Therefore, I think the case you're trying to fix cannot
> > happen in the current state - the fix is also wrong, see below.
> >
> >
> > >
> > >      if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen,
> tlsVerify,
> > > -                                     *secAlias, qemuCaps, tlsProps) <
> 0)
> > > +                                     **secAlias ? *secAlias : NULL,
> qemuCaps,
> >
> > So, hypothetically, if secAlias == NULL and *secAlias results in a
> SEGFAULT,
> > what is the result of doing **secAlias? Correct, a SEGFAULT.
> >
> > Erik
> >
> > --
> > libvir-list mailing list
> > libvir-list at redhat.com
> > https://www.redhat.com/mailman/listinfo/libvir-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170920/52369085/attachment-0001.htm>


More information about the libvir-list mailing list