[libvirt] [PATCH v3 27/30] qemu: Don't leak storage perms on failure in qemuDomainAttachDiskGeneric

Cole Robinson crobinso at redhat.com
Tue Dec 10 20:56:31 UTC 2019


On 12/2/19 9:26 AM, Michal Privoznik wrote:
> At the very beginning of the attach function the
> qemuDomainStorageSourceChainAccessAllow() is called which
> modifies CGroups, locks and seclabels for new disk and its
> backing chain. This must be followed by a counterpart which
> reverts back all the changes if something goes wrong. This boils
> down to calling qemuDomainStorageSourceChainAccessRevoke() which
> is done under 'error' label. But not all failure branches jump
> there. They just jump onto 'cleanup' label where no revoke is
> done. Such mistake is easy to do because 'cleanup' label does
> exist. Therefore, dissolve 'error' block in 'cleanup' and have
> everything jump onto 'cleanup' label.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>

Reviewed-by: Cole Robinson <crobinso at redhat.com>

- Cole




More information about the libvir-list mailing list