]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Improper pty permissions - missing mode=0620, gid=5
authorStéphane Graber <stgraber@ubuntu.com>
Tue, 15 Oct 2013 18:54:41 +0000 (14:54 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 16 Oct 2013 16:47:14 +0000 (11:47 -0500)
This fix is coming from Debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720122

The reason for the hardcoded gid= and mode= is because of the fix for
CVE-2013-2207 which removes pt_chown from glibc and so requires proper
write access to devpts.

It looks like the "tty" group is guaranteed to be gid=5 on at least all
RedHat based and Debian based systems. So this hardcode gid shouldn't be
a big problem. If we however support any distro where that's not the
case, we'll need to implement an extra lxc.conf option and matching
template changes.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index 457fa2635f20b6495adc56e403db6da942f5f87a..208c08ba5384b7ffae2421d7189323af5570d3ef 100644 (file)
@@ -1427,7 +1427,7 @@ static int setup_pts(int pts)
        }
 
        if (mount("devpts", "/dev/pts", "devpts", MS_MGC_VAL,
-                 "newinstance,ptmxmode=0666")) {
+                 "newinstance,ptmxmode=0666,mode=0620,gid=5")) {
                SYSERROR("failed to mount a new instance of '/dev/pts'");
                return -1;
        }