]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: fix possible panic when CONFIG_MM_OWNER=y
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Mon, 12 May 2008 21:02:31 +0000 (14:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 13 May 2008 15:02:25 +0000 (08:02 -0700)
commitc6fad655369e1d47a0842bd25a38c284e64094c3
tree2acebe40e15b91a3df78ea5b677a84c509a30ae0
parent9a48a70996f93fd846391d6201dc121eeeed6742
memcg: fix possible panic when CONFIG_MM_OWNER=y

When mm destruction happens, we should pass mm_update_next_owner() the old mm.
 But unfortunately new mm is passed in exec_mmap().

Thus, kernel panic is possible when a multi-threaded process uses exec().

Also, the owner member comment description is wrong.  mm->owner does not
necessarily point to the thread group leader.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: "Paul Menage" <menage@google.com>
Cc: "KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c
include/linux/mm_types.h