security: selinux: Fix crash when releasing non-existent label
This can be triggered by the qemuStartVMDaemon cleanup path if a VM references a non-existent USB device (by product) in the XML.
This commit is contained in:
parent
b7a7b33651
commit
65e97240e6
@ -632,7 +632,8 @@ SELinuxReleaseSecurityLabel(virDomainObjPtr vm)
|
|||||||
{
|
{
|
||||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||||
|
|
||||||
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
|
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC ||
|
||||||
|
secdef->label == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
context_t con = context_new(secdef->label);
|
context_t con = context_new(secdef->label);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user