]> git.proxmox.com Git - mirror_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)
committerTycho Andersen <tycho@tycho.ws>
Thu, 14 Dec 2017 00:26:02 +0000 (00:26 +0000)
commitd76e3e1a5b70b46af860b9bf77fd1151ff3847c4
treec0e18bc2875a81e79bec695252260a55d8abbbed
parent4be4832738cbcb376a65740e9641d63cdec6e641
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