]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_tpm: Restore TPM labels on failed start
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 14 Dec 2022 14:12:38 +0000 (15:12 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Jan 2023 16:19:22 +0000 (17:19 +0100)
commitc0c52a951999e9ed1948e650e07fe235f5a61944
treed6a13c2613dfcc58b7c7b1230120f9c51f7596e4
parentbdbb8e7b00f29567491542204ebaf42eedf87df0
qemu_tpm: Restore TPM labels on failed start

If swtpm binary fails to start after successful exec() (e.g. it
fails to initialize itself), the seclabels set in
qemuSecurityStartTPMEmulator() are not restored. This is due to
lacking qemuSecurityRestoreTPMLabels() call in the error path.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_tpm.c