[libvirt] [PATCH v2] Fix libvirtd crash in qemuDomainGetTLSObjects

Peter Krempa pkrempa at redhat.com
Wed Sep 20 12:18:10 UTC 2017


On Wed, Sep 20, 2017 at 08:14:39 -0400, John Ferlan wrote:
> 
> 
> On 09/20/2017 08:11 AM, Erik Skultety wrote:
> > On Wed, Sep 20, 2017 at 05:02:36AM -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
> >>
> >> Changed code to not dereference a NULL secAlias.
> >>
> >> Signed-off-by: Ashish Mittal <ashmit602 at gmail.com>
> > 
> > Looks better, but this should IMHO go as part of the larger series, because on
> > its own, it doesn't make much sense to fix an issue that doesn't exist yet, but
> > will in a short period of time. Therefore, rather than doing it in a separate
> > patch, we should make it part of the series, because, repeating myself, this
> > should be a mere adjustment necessary for the larger series to work properly,
> > not a fix of an issue - the issue should either exist already or the series
> > shouldn't introduce a crasher in the first place.
> > 
> > Erik
> > 
> 
> I asked for a separate patch although while related to what's changing
> for the larger Veritas VxHS series, it is still a bug in the code today
> even though we haven't yet hit it because our callers have provided the
> secalias.
> 
> Perhaps the commit message could be stated "Avoid a possible NULL
> dereference on a parameter that is checked for NULL in other places."

Yes. Exactly. The patch should be pushed prior to the code which would
crash, thus the crash will never happen and the backtrace and whole
commit message will be wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170920/5684c8bf/attachment-0001.sig>


More information about the libvir-list mailing list