]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Linux Containers are not allowed to create device nodes.
authorDan Walsh <dwalsh@redhat.com>
Thu, 1 Nov 2012 18:54:39 +0000 (14:54 -0400)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:12:35 +0000 (16:12 -0500)
This needs to be done before the container starts. Turning
off the mknod capability is noticed by systemd, which will
no longer attempt to create device nodes.

This eliminates SELinux AVC messages and ugly failure messages in the journal.
(cherry picked from commit 2e03b08ead603c38c244aa9a1ecef6d73bb306be)

src/lxc/lxc_container.c

index 2789c17529f26c1deb6d8a3ecc703679f87ed300..8faa664d744c974b76eae34224ce1d323f068a32 100644 (file)
@@ -1717,6 +1717,7 @@ static int lxcContainerDropCapabilities(bool keepReboot ATTRIBUTE_UNUSED)
                              CAPNG_INHERITABLE | CAPNG_BOUNDING_SET,
                              CAP_SYS_MODULE, /* No kernel module loading */
                              CAP_SYS_TIME, /* No changing the clock */
+                             CAP_MKNOD, /* No creating device nodes */
                              CAP_AUDIT_CONTROL, /* No messing with auditing status */
                              CAP_MAC_ADMIN, /* No messing with LSM config */
                              keepReboot ? -1 : CAP_SYS_BOOT, /* No use of reboot */