[libvirt] [PATCH] qemu: hotplug: Don't access srcPriv when it's not allocated

Peter Krempa pkrempa at redhat.com
Tue Jul 3 14:22:35 UTC 2018


On Tue, Jul 03, 2018 at 09:34:56 -0400, John Ferlan wrote:
> 
> 
> On 07/03/2018 08:05 AM, Peter Krempa wrote:
> > The private data of a virStorageSource which is backing an iSCSI hostdev
> > may be NULL if no authentication is present. The code handling the
> > hotplug would attempt to extract the authentication info stored in
> > 'secinfo' without checking if it is allocated which resulted in a crash.
> > 
> > Here we opt the easy way to check if srcPriv is not NULL so that we
> > don't duplicate all the logic which selects whether the disk source has
> > a secret.
> > 
> > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1597550
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >  src/qemu/qemu_hotplug.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> 
> Reviewed-by: John Ferlan <jferlan at redhat.com>
> 
> John
> 
> Feels like we've done this before...
> 
> 97202988 <sigh> and 6050affb7f

Specifically the former commit was not good enough to cover this case
despite touching this code.

-------------- 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/20180703/e77e37ca/attachment-0001.sig>


More information about the libvir-list mailing list