All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mm_owner: fix cgroup null dereference
@ 2008-08-14 20:16 ` Jiri Slaby
  0 siblings, 0 replies; 27+ messages in thread
From: Jiri Slaby @ 2008-08-14 20:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: containers, linux-mm, linux-kernel, Jiri Slaby, Balbir Singh

Hi,

found this in mmotm, a fix for
mm-owner-fix-race-between-swap-and-exit.patch

--

mm->owner is set to NULL prior to calling cgroup_mm_owner_callbacks,
but it should be set after that to not pass NULL pointer as the old
owner which otherwise results in an oops (shortened):

BUG: unable to handle kernel NULL pointer dereference at 0000000000000580
Oops: 0000 [1] SMP
Pid: 3396, comm: nscd Tainted: G        W 2.6.27-rc3-mm1_64 #439
RIP: 0010:[<ffffffff8027035a>]  [<ffffffff8027035a>] cgroup_mm_owner_callbacks+0x3a/0x90
RAX: 0000000000000000 RBX: ffffffff80589720 RCX: ffff880079f503e8
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff806c36e0
RBP: ffff880078291bd8 R08: ffff880078290000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8800787f8e20
Call Trace:
 [<ffffffff8023d42a>] mm_update_next_owner+0x1ca/0x240
 [<ffffffff8023d5aa>] exit_mm+0x10a/0x150
 [<ffffffff8023f1fc>] do_exit+0x1dc/0x940
Code: 89 fe 41 55 49 89 f5 41 54 53 74 68 48 c7 c3 20 97 58 80 45 31 e4 0f 1f 00 48 8b 3b 4d 85 ed 48 63 47 58 48 8d 14 c5 00 00 00 00 <49> 8b 86 80 05 00 00 48 8d 44 10 38 48 8b 00 48 8b 30 74 12 49

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 3f47470..3a2a42a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -637,8 +637,8 @@ retry:
 	 * the callback and take action
 	 */
 	down_write(&mm->mmap_sem);
-	mm->owner = NULL;
 	cgroup_mm_owner_callbacks(mm->owner, NULL);
+	mm->owner = NULL;
 	up_write(&mm->mmap_sem);
 	return;
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 27+ messages in thread
* [PATCH 1/1] mm_owner: fix cgroup null dereference
@ 2008-08-14 20:16 Jiri Slaby
  0 siblings, 0 replies; 27+ messages in thread
From: Jiri Slaby @ 2008-08-14 20:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Balbir Singh, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jiri Slaby

Hi,

found this in mmotm, a fix for
mm-owner-fix-race-between-swap-and-exit.patch

--

mm->owner is set to NULL prior to calling cgroup_mm_owner_callbacks,
but it should be set after that to not pass NULL pointer as the old
owner which otherwise results in an oops (shortened):

BUG: unable to handle kernel NULL pointer dereference at 0000000000000580
Oops: 0000 [1] SMP
Pid: 3396, comm: nscd Tainted: G        W 2.6.27-rc3-mm1_64 #439
RIP: 0010:[<ffffffff8027035a>]  [<ffffffff8027035a>] cgroup_mm_owner_callbacks+0x3a/0x90
RAX: 0000000000000000 RBX: ffffffff80589720 RCX: ffff880079f503e8
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff806c36e0
RBP: ffff880078291bd8 R08: ffff880078290000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8800787f8e20
Call Trace:
 [<ffffffff8023d42a>] mm_update_next_owner+0x1ca/0x240
 [<ffffffff8023d5aa>] exit_mm+0x10a/0x150
 [<ffffffff8023f1fc>] do_exit+0x1dc/0x940
Code: 89 fe 41 55 49 89 f5 41 54 53 74 68 48 c7 c3 20 97 58 80 45 31 e4 0f 1f 00 48 8b 3b 4d 85 ed 48 63 47 58 48 8d 14 c5 00 00 00 00 <49> 8b 86 80 05 00 00 48 8d 44 10 38 48 8b 00 48 8b 30 74 12 49

Signed-off-by: Jiri Slaby <jirislaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Balbir Singh <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index 3f47470..3a2a42a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -637,8 +637,8 @@ retry:
 	 * the callback and take action
 	 */
 	down_write(&mm->mmap_sem);
-	mm->owner = NULL;
 	cgroup_mm_owner_callbacks(mm->owner, NULL);
+	mm->owner = NULL;
 	up_write(&mm->mmap_sem);
 	return;
 
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2008-08-20  6:59 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 20:16 [PATCH 1/1] mm_owner: fix cgroup null dereference Jiri Slaby
2008-08-14 20:16 ` Jiri Slaby
2008-08-14 20:58 ` Balbir Singh
2008-08-14 20:58   ` Balbir Singh
2008-08-18 21:22   ` Jiri Slaby
2008-08-18 21:22     ` Jiri Slaby
     [not found]     ` <48A9E82E.3060009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-19  3:37       ` Balbir Singh
2008-08-19  3:37     ` Balbir Singh
2008-08-19  3:37       ` Balbir Singh
2008-08-19  9:49       ` Jiri Slaby
2008-08-19  9:49         ` Jiri Slaby
     [not found]         ` <48AA970D.5050403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-19 10:36           ` Balbir Singh
2008-08-19 10:36         ` Balbir Singh
2008-08-19 10:36           ` Balbir Singh
     [not found]       ` <48AA4003.5080300-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-08-19  9:49         ` Jiri Slaby
     [not found]   ` <48A49C78.7070100-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-08-18 21:22     ` Jiri Slaby
     [not found] ` <1218745013-9537-1-git-send-email-jirislaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-14 20:58   ` Balbir Singh
2008-08-19 14:13   ` Balbir Singh
2008-08-19 14:13 ` Balbir Singh
2008-08-19 14:13   ` Balbir Singh
2008-08-20  5:20   ` Li Zefan
2008-08-20  5:20     ` Li Zefan
2008-08-20  6:59     ` KAMEZAWA Hiroyuki
2008-08-20  6:59       ` KAMEZAWA Hiroyuki
     [not found]     ` <48ABA9A8.1060806-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2008-08-20  6:59       ` KAMEZAWA Hiroyuki
     [not found]   ` <20080819141344.GF25239-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2008-08-20  5:20     ` Li Zefan
  -- strict thread matches above, loose matches on Subject: below --
2008-08-14 20:16 Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.