• Li Zefan's avatar
    cgroups: fix a race between cgroup_clone and umount · 7b574b7b
    Li Zefan authored
    The race is calling cgroup_clone() while umounting the ns cgroup subsys,
    and thus cgroup_clone() might access invalid cgroup_fs, or kill_sb() is
    called after cgroup_clone() created a new dir in it.
    
    The BUG I triggered is BUG_ON(root->number_of_cgroups != 1);
    
      ------------[ cut here ]------------
      kernel BUG at kernel/cgroup.c:1093!
      invalid opcode: 0000 [#1] SMP
      ...
      Process umount (pid: 5177, ti=e411e000 task=e40c4670 task.ti=e411e000)
      ...
      Call Trace:
       [<c0493df7>] ? deactivate_super+0x3f/0x51
       [<c04a3600>] ? mntput_no_expire+0xb3/0xdd
       [<c04a3ab2>] ? sys_umount+0x265/0x2ac
       [<c04a3b06>] ? sys_oldumount+0xd/0xf
       [<c0403911>] ? sysenter_do_call+0x12/0x31
      ...
      EIP: [<c0456e76>] cgroup_kill_sb+0x23/0xe0 SS:ESP 0068:e411ef2c
      ---[ end trace c766c1be3bf944ac ]---
    
    Cc: Serge E. Hallyn <serue@us.ibm.com>
    Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    Cc: Paul Menage <menage@google.com>
    Cc: "Serge E. Hallyn" <serue@us.ibm.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: <stable@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7b574b7b
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
usr Loading commit data...
virt/kvm Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...