|
|
edecca |
From a97299d1417a7982ebdb3182eded45066b9f5425 Mon Sep 17 00:00:00 2001
|
|
|
edecca |
Message-Id: <a97299d1417a7982ebdb3182eded45066b9f5425@dist-git>
|
|
|
edecca |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
edecca |
Date: Tue, 3 Jul 2018 16:48:38 +0200
|
|
|
edecca |
Subject: [PATCH] qemu: hotplug: Don't access srcPriv when it's not allocated
|
|
|
edecca |
|
|
|
edecca |
The private data of a virStorageSource which is backing an iSCSI hostdev
|
|
|
edecca |
may be NULL if no authentication is present. The code handling the
|
|
|
edecca |
hotplug would attempt to extract the authentication info stored in
|
|
|
edecca |
'secinfo' without checking if it is allocated which resulted in a crash.
|
|
|
edecca |
|
|
|
edecca |
Here we opt the easy way to check if srcPriv is not NULL so that we
|
|
|
edecca |
don't duplicate all the logic which selects whether the disk source has
|
|
|
edecca |
a secret.
|
|
|
edecca |
|
|
|
edecca |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1597550
|
|
|
edecca |
|
|
|
edecca |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
edecca |
Reviewed-by: John Ferlan <jferlan@redhat.com>
|
|
|
edecca |
(cherry picked from commit 33a475056fdd76c030528982e422bae79c0a0e4a)
|
|
|
edecca |
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
edecca |
---
|
|
|
edecca |
src/qemu/qemu_hotplug.c | 3 ++-
|
|
|
edecca |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
edecca |
|
|
|
edecca |
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
|
edecca |
index fcd8eb0ffa..075f2fb72e 100644
|
|
|
edecca |
--- a/src/qemu/qemu_hotplug.c
|
|
|
edecca |
+++ b/src/qemu/qemu_hotplug.c
|
|
|
edecca |
@@ -2240,7 +2240,8 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver,
|
|
|
edecca |
if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
|
|
|
edecca |
qemuDomainStorageSourcePrivatePtr srcPriv =
|
|
|
edecca |
QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(scsisrc->u.iscsi.src);
|
|
|
edecca |
- secinfo = srcPriv->secinfo;
|
|
|
edecca |
+ if (srcPriv)
|
|
|
edecca |
+ secinfo = srcPriv->secinfo;
|
|
|
edecca |
}
|
|
|
edecca |
|
|
|
edecca |
if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) {
|
|
|
edecca |
--
|
|
|
edecca |
2.18.0
|
|
|
edecca |
|