diff options
| author | Paul Menage <[email protected]> | 2008-12-15 21:54:22 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2008-12-16 00:27:07 +0000 |
| commit | 307257cf475aac25db30b669987f13d90c934e3a (patch) | |
| tree | 393a2c87fd1834aed3e686b65ba5479bae871b0d /net/unix/af_unix.c | |
| parent | ACPI toshiba: only register rfkill if bt is enabled (diff) | |
| download | kernel-307257cf475aac25db30b669987f13d90c934e3a.tar.gz kernel-307257cf475aac25db30b669987f13d90c934e3a.zip | |
cgroups: fix a race between rmdir and remount
When a cgroup is removed, it's unlinked from its parent's children list,
but not actually freed until the last dentry on it is released (at which
point cgrp->root->number_of_cgroups is decremented).
Currently rebind_subsystems checks for the top cgroup's child list being
empty in order to rebind subsystems into or out of a hierarchy - this can
result in the set of subsystems bound to a hierarchy being
removed-but-not-freed cgroup.
The simplest fix for this is to forbid remounts that change the set of
subsystems on a hierarchy that has removed-but-not-freed cgroups. This
bug can be reproduced via:
mkdir /mnt/cg
mount -t cgroup -o ns,freezer cgroup /mnt/cg
mkdir /mnt/cg/foo
sleep 1h < /mnt/cg/foo &
rmdir /mnt/cg/foo
mount -t cgroup -o remount,ns,devices,freezer cgroup /mnt/cg
kill $!
Though the above will cause oops in -mm only but not mainline, but the bug
can cause memory leak in mainline (and even oops)
Signed-off-by: Paul Menage <[email protected]>
Reviewed-by: Li Zefan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
