]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security: Do not restore kernel and initrd labels
authorJiri Denemark <jdenemar@redhat.com>
Fri, 15 Jan 2016 09:55:58 +0000 (10:55 +0100)
committerCole Robinson <crobinso@redhat.com>
Thu, 21 Jan 2016 00:14:06 +0000 (19:14 -0500)
Kernel/initrd files are essentially read-only shareable images and thus
should be handled in the same way. We already use the appropriate label
for kernel/initrd files when starting a domain, but when a domain gets
destroyed we would remove the labels which would make other running
domains using the same files very unhappy.

https://bugzilla.redhat.com/show_bug.cgi?id=921135

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 68acc701bd449481e3206723c25b18fcd3d261b7)

src/security/security_dac.c
src/security/security_selinux.c

index deb69803095bf78c5f543289a295d71190235a56..d01215faedda24e5c57268cf461a2ff62504060c 100644 (file)
@@ -971,14 +971,6 @@ virSecurityDACRestoreSecurityAllLabel(virSecurityManagerPtr mgr,
         virSecurityDACRestoreSecurityFileLabel(def->os.loader->nvram) < 0)
         rc = -1;
 
-    if (def->os.kernel &&
-        virSecurityDACRestoreSecurityFileLabel(def->os.kernel) < 0)
-        rc = -1;
-
-    if (def->os.initrd &&
-        virSecurityDACRestoreSecurityFileLabel(def->os.initrd) < 0)
-        rc = -1;
-
     if (def->os.dtb &&
         virSecurityDACRestoreSecurityFileLabel(def->os.dtb) < 0)
         rc = -1;
index c2464c2bfba173312b10edcd6c8fcfd764bb08fa..38f2a290a92ec85420036cc0a887384b2257d7c4 100644 (file)
@@ -1978,14 +1978,6 @@ virSecuritySELinuxRestoreSecurityAllLabel(virSecurityManagerPtr mgr,
         virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.loader->nvram) < 0)
         rc = -1;
 
-    if (def->os.kernel &&
-        virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.kernel) < 0)
-        rc = -1;
-
-    if (def->os.initrd &&
-        virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.initrd) < 0)
-        rc = -1;
-
     if (def->os.dtb &&
         virSecuritySELinuxRestoreSecurityFileLabel(mgr, def->os.dtb) < 0)
         rc = -1;