提交 28423019 编写于 作者: J Jim Fehlig

Prevent crash of libvirtd when attaching to existing qemu process

With security_driver set to "none" in /etc/libvirt/qemu.conf,
libvirtd would crash when attempted to attach to an existing
qemu process.  Only copy the security model if it actually exists.
上级 8d16201f
...@@ -3609,7 +3609,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -3609,7 +3609,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
if (virSecurityManagerGetProcessLabel(driver->securityManager, if (virSecurityManagerGetProcessLabel(driver->securityManager,
vm, seclabel) < 0) vm, seclabel) < 0)
goto cleanup; goto cleanup;
if (!(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model))) if (driver->caps->host.secModel.model &&
!(vm->def->seclabel.model = strdup(driver->caps->host.secModel.model)))
goto no_memory; goto no_memory;
if (!(vm->def->seclabel.label = strdup(seclabel->label))) if (!(vm->def->seclabel.label = strdup(seclabel->label)))
goto no_memory; goto no_memory;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册