]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
a .27 patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 14 Aug 2010 18:44:42 +0000 (11:44 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 14 Aug 2010 18:44:42 +0000 (11:44 -0700)
review-2.6.27/mm-pass-correct-mm-when-growing-stack.patch [new file with mode: 0644]
review-2.6.27/series

diff --git a/review-2.6.27/mm-pass-correct-mm-when-growing-stack.patch b/review-2.6.27/mm-pass-correct-mm-when-growing-stack.patch
new file mode 100644 (file)
index 0000000..3697ca3
--- /dev/null
@@ -0,0 +1,39 @@
+From 05fa199d45c54a9bda7aa3ae6537253d6f097aa9 Mon Sep 17 00:00:00 2001
+From: Hugh Dickins <hugh@veritas.com>
+Date: Thu, 16 Apr 2009 21:58:12 +0100
+Subject: mm: pass correct mm when growing stack
+
+From: Hugh Dickins <hugh@veritas.com>
+
+commit 05fa199d45c54a9bda7aa3ae6537253d6f097aa9 upstream.
+
+Tetsuo Handa reports seeing the WARN_ON(current->mm == NULL) in
+security_vm_enough_memory(), when do_execve() is touching the
+target mm's stack, to set up its args and environment.
+
+Yes, a UMH_NO_WAIT or UMH_WAIT_PROC call_usermodehelper() spawns
+an mm-less kernel thread to do the exec.  And in any case, that
+vm_enough_memory check when growing stack ought to be done on the
+target mm, not on the execer's mm (though apart from the warning,
+it only makes a slight tweak to OVERCOMMIT_NEVER behaviour).
+
+Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
+Signed-off-by: Hugh Dickins <hugh@veritas.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ mm/mmap.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/mmap.c
++++ b/mm/mmap.c
+@@ -1573,7 +1573,7 @@ static int acct_stack_growth(struct vm_a
+        * Overcommit..  This must be the final test, as it will
+        * update security statistics.
+        */
+-      if (security_vm_enough_memory(grow))
++      if (security_vm_enough_memory_mm(mm, grow))
+               return -ENOMEM;
+       /* Ok, everything looks good - let it rip */
index 17f310026931ef138c97d7129383f51822a58d39..7c26ef1fcb39cede933bf38931d38319151ec667 100644 (file)
@@ -1,3 +1,4 @@
 mm-keep-a-guard-page-below-a-grow-down-stack-segment.patch
 mm-fix-missing-page-table-unmap-for-stack-guard-page-failure-case.patch
 x86-don-t-send-sigbus-for-kernel-page-faults.patch
+mm-pass-correct-mm-when-growing-stack.patch