summaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-03-20 11:10:15 -0400
committerTejun Heo <tj@kernel.org>2014-03-20 11:10:15 -0400
commite1b2dc176f2d5be7952c47a4e4e8f3b06a90db1c (patch)
tree770797e88466920af0354358e5707a2397487628 /kernel/fork.c
parent1b9aba49eab5e85b0d3de8ba630cda6d68546297 (diff)
downloadop-kernel-dev-e1b2dc176f2d5be7952c47a4e4e8f3b06a90db1c.zip
op-kernel-dev-e1b2dc176f2d5be7952c47a4e4e8f3b06a90db1c.tar.gz
cgroup: break kernfs active_ref protection in cgroup directory operations
cgroup_tree_mutex should nest above the kernfs active_ref protection; however, cgroup_create() and cgroup_rename() were grabbing cgroup_tree_mutex while under kernfs active_ref protection. This has actualy possibility to lead to deadlocks in case these operations race against cgroup_rmdir() which invokes kernfs_remove() on directory kernfs_node while holding cgroup_tree_mutex. Neither cgroup_create() or cgroup_rename() requires active_ref protection. The former already has enough synchronization through cgroup_lock_live_group() and the latter doesn't care, so this can be fixed by updating both functions to break all active_ref protections before grabbing cgroup_tree_mutex. While this patch fixes the immediate issue, it probably needs further work in the long term - kernfs directories should enable lockdep annotations and maybe the better way to handle this is marking directory nodes as not needing active_ref protection rather than breaking it in each operation. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/fork.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud