]> git.ipfire.org Git - thirdparty/lxc.git/commit
attach: handle /proc with hidepid={1,2} property 2047/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 20 Dec 2017 23:42:37 +0000 (00:42 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 21 Dec 2017 07:00:35 +0000 (08:00 +0100)
commit57de839fd507c5bed57e563c92225b208e1c4324
tree91efabef7628014dc69855bad9b3fc2168651eab
parenta998454a2adac201728d3137869709710627ab19
attach: handle /proc with hidepid={1,2} property

Receive fd for LSM security module before we set{g,u}id(). The reason is that
on set{g,u}id() the kernel will a) make us undumpable and b) we will change our
effective uid. This means our effective uid will be different from the
effective uid of the process that created us which means that this processs no
longer has capabilities in our namespace including CAP_SYS_PTRACE. This means
we will not be able to read and /proc/<pid> files for the process anymore when
/proc is mounted with hidepid={1,2}. So let's get the lsm label fd before the
set{g,u}id().

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