]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgroup: prevent DOS when a hierachy is mounted multiple times
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 15 May 2013 20:21:24 +0000 (15:21 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 16 May 2013 12:24:21 +0000 (07:24 -0500)
commit9a93d99213da44b5ddf2f5295f6ef3a59d4f1fba
treed922c8fbb811b6b2a85bcaecf99a22d48f014389
parent6031a6e5f939bda07d98768d34dafae677a7dfeb
cgroup: prevent DOS when a hierachy is mounted multiple times

When starting a container, we walk through all cgroup mounts looking
for a unique directory name we can use for this container.  If the
name we are trying is in use, we try another name.  If it is not in
use in the first mount we check, we need to check other hierarchies
as it may exist there.  But we weren't checking whether we have already
checked a subsystem - so that if freezer was mounted twice, we would
create it in the first mount, see it exists in the second, so start
over trying in the second mount.

To fix this, keep track of which subsystems we have already checked,
and do not re-check.

(See http://pad.lv/1176287 for a bug report)

Note we still need to add, at the next: label, the removal of the
directories we've already created.  I'm keeping that for later as
it's far lower priority than this fix, and I don't want to risk
introducing a regression for that.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgroup.c