]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
Ensure securityfs is mounted readonly in container
authorDan Walsh <dwalsh@redhat.com>
Thu, 8 Aug 2013 11:51:01 +0000 (12:51 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 8 Aug 2013 13:25:50 +0000 (14:25 +0100)
If securityfs is available on the host, we should ensure to
mount it read-only in the container. This will avoid systemd
trying to mount it during startup causing SELinux AVCs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_container.c

index b910b1039bbc64b5cf38fcd4f11252c8104a5cf3..a943b22927e2280ab9b0e7fb56f44ec4d3f30479 100644 (file)
@@ -770,6 +770,8 @@ static int lxcContainerMountBasicFS(void)
         { "/proc/sys", "/proc/sys", NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY },
         { "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV },
         { "sysfs", "/sys", "sysfs", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY },
+        { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV },
+        { "securityfs", "/sys/kernel/security", "securityfs", NULL, MS_BIND|MS_REMOUNT|MS_RDONLY },
 #if WITH_SELINUX
         { SELINUX_MOUNT, SELINUX_MOUNT, "selinuxfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV },
         { SELINUX_MOUNT, SELINUX_MOUNT, NULL, NULL, MS_BIND|MS_REMOUNT|MS_RDONLY },