]> git.ipfire.org Git - thirdparty/lxc.git/commit
CVE-2016-10124: make lxc-attach use a pty
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 16 Jan 2017 14:10:45 +0000 (15:10 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 4 Apr 2017 14:52:34 +0000 (16:52 +0200)
commit99e98d9afa2bea1d299859d35f7547ef9e2fabe6
tree75e2b3b167c2b967113e41890025bcf1c45f6469
parentd670421686b5515732dd503d7aa963381a45275e
CVE-2016-10124: make lxc-attach use a pty

Previous versions of lxc-attach simply attached to the specified namespaces of
a container and ran a shell or the specified command without first allocating a
pseudo terminal. This made them vulnerable to input faking via a TIOCSTI ioctl
call after switching between userspace execution contexts with different
privilege levels. Newer versions of lxc-attach will try to allocate a pseudo
terminal master/slave pair on the host and attach any standard file descriptors
which refer to a terminal to the slave side of the pseudo terminal before
executing a shell or command. Note, that if none of the standard file
descriptors refer to a  terminal lxc-attach will not try to allocate a pseudo
terminal. Instead it will simply attach to the containers namespaces and run a
shell or the specified command.

(This is a backport of a series of patches fixing CVE-2016-10124.)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxc_attach.c