lkml.org 
[lkml]   [2014]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cgroup: missing rcu read lock around task_css_set
Date
rcu read lock should be held when calling and working with task_css_set.

This patch also fixes a related lockdep warning.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
kernel/cgroup.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 8f4ddbe..f638ad6 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4361,6 +4361,7 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
}

/* Reassign the task to the init_css_set. */
+ rcu_read_lock();
cset = task_css_set(tsk);
RCU_INIT_POINTER(tsk->cgroups, &init_css_set);

@@ -4378,6 +4379,7 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)

if (put_cset)
put_css_set(cset, true);
+ rcu_read_unlock();
}

static void check_for_release(struct cgroup *cgrp)
--
1.7.2.5


\
 
 \ /
  Last update: 2014-03-02 04:41    [W:4.421 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site