]> git.ipfire.org Git - thirdparty/lxc.git/commit
init: don't kill(-1) if we aren't in a pid ns
authorTycho Andersen <tycho@tycho.ws>
Fri, 8 Dec 2017 23:23:26 +0000 (23:23 +0000)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 17 Dec 2017 15:44:49 +0000 (16:44 +0100)
commit76c3176350d610ecce9bb9f38bd0ffcca1a24720
tree40d30b4360656fbac58607db2ec62a081b0ba126
parent662a98320301d2eb7acea39ebadcb7b5fa7d2f21
init: don't kill(-1) if we aren't in a pid ns

...otherwise we'll kill everyone on the machine. Instead, let's explicitly
try to kill our children. Let's do a best effort against fork bombs by
disabling forking via the pids cgroup if it exists. This is best effort for
a number of reasons:

* the pids cgroup may not be available
* the container may have bind mounted /dev/null over pids.max, so the write
  doesn't do anything

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/lxc_init.c