mirror of https://gitee.com/openkylin/linux.git
memcg: use rcu_dereference to access mm->owner
mm->owner should be accessed with rcu_dereference(). Reported-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c12ddba093
commit
e638c13940
|
@ -75,7 +75,7 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
|
|||
{
|
||||
struct mem_cgroup *mem;
|
||||
rcu_read_lock();
|
||||
mem = mem_cgroup_from_task((mm)->owner);
|
||||
mem = mem_cgroup_from_task(rcu_dereference((mm)->owner));
|
||||
rcu_read_unlock();
|
||||
return cgroup == mem;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue