diff options
author | Waiman Long <longman@redhat.com> | 2017-05-15 09:34:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-14 15:06:00 +0200 |
commit | dff4c8bb1397337bc7663447d7f6ccbb3a52f8d9 (patch) | |
tree | fd113b4a4a7b326a13f38ee4d24b598e634e426b /kernel | |
parent | b59ec7072c84c09461d98376a3358879d0034098 (diff) |
cgroup: Prevent kill_css() from being called more than once
commit 33c35aa4817864e056fd772230b0c6b552e36ea2 upstream.
The kill_css() function may be called more than once under the condition
that the css was killed but not physically removed yet followed by the
removal of the cgroup that is hosting the css. This patch prevents any
harmm from being done when that happens.
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cgroup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a3d2aad2443f..1fde8eec9529 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -5407,6 +5407,11 @@ static void kill_css(struct cgroup_subsys_state *css) { lockdep_assert_held(&cgroup_mutex); + if (css->flags & CSS_DYING) + return; + + css->flags |= CSS_DYING; + /* * This must happen before css is disassociated with its cgroup. * See seq_css() for details. |