Blame SOURCES/libvirt-virDomainDeviceValidateAliasForHotplug-Use-correct-domain-defintion.patch

952426
From 9c5bfad7725766860abf41d47a55f6fbdd9130bb Mon Sep 17 00:00:00 2001
952426
Message-Id: <9c5bfad7725766860abf41d47a55f6fbdd9130bb@dist-git>
952426
From: Michal Privoznik <mprivozn@redhat.com>
952426
Date: Wed, 14 Mar 2018 08:18:43 +0100
952426
Subject: [PATCH] virDomainDeviceValidateAliasForHotplug: Use correct domain
952426
 defintion
952426
952426
RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1543775
952426
RHEL-7.5.z: https://bugzilla.redhat.com/show_bug.cgi?id=1554928
952426
952426
For some weird reason this function is getting live and
952426
persistent def for domain but then accesses vm->def and
952426
vm->newDef directly. This is rather unsafe as we can be
952426
accessing NULL pointer.
952426
952426
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
952426
(cherry picked from commit e5673ed44465edcfccdd906158136ad8dcb94b9b)
952426
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
952426
---
952426
 src/conf/domain_conf.c | 4 ++--
952426
 1 file changed, 2 insertions(+), 2 deletions(-)
952426
952426
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
952426
index 1a3db4a7be..c746ab19cd 100644
952426
--- a/src/conf/domain_conf.c
952426
+++ b/src/conf/domain_conf.c
952426
@@ -5666,11 +5666,11 @@ virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm,
952426
         return -1;
952426
 
952426
     if (persDef &&
952426
-        virDomainDeviceValidateAliasImpl(vm->def, dev) < 0)
952426
+        virDomainDeviceValidateAliasImpl(persDef, dev) < 0)
952426
         return -1;
952426
 
952426
     if (liveDef &&
952426
-        virDomainDeviceValidateAliasImpl(vm->newDef, dev) < 0)
952426
+        virDomainDeviceValidateAliasImpl(liveDef, dev) < 0)
952426
         return -1;
952426
 
952426
     return 0;
952426
-- 
952426
2.16.2
952426