All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-search_binary_handler-mem-limit-fix.patch added to -mm tree
@ 2007-01-24  9:09 akpm
  2007-01-29 11:33 ` Heiko Carstens
  0 siblings, 1 reply; 7+ messages in thread
From: akpm @ 2007-01-24  9:09 UTC (permalink / raw)
  To: mm-commits; +Cc: dmonakhov


The patch titled
     mm: search_binary_handler() mem limit fix
has been added to the -mm tree.  Its filename is
     mm-search_binary_handler-mem-limit-fix.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: mm: search_binary_handler() mem limit fix
From: Dmitriy Monakhov <dmonakhov@openvz.org>

The function changes mem limit to USER_DS before possible modprobe, but
never restored it again.

Signed-off-by: Dmitriy Monakhov <dmonakhov@openvz.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/exec.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff -puN fs/exec.c~mm-search_binary_handler-mem-limit-fix fs/exec.c
--- a/fs/exec.c~mm-search_binary_handler-mem-limit-fix
+++ a/fs/exec.c
@@ -1018,6 +1018,7 @@ int search_binary_handler(struct linux_b
 {
 	int try,retval;
 	struct linux_binfmt *fmt;
+	mm_segment_t oldfs;
 #ifdef __alpha__
 	/* handle /sbin/loader.. */
 	{
@@ -1059,11 +1060,12 @@ int search_binary_handler(struct linux_b
 
 	/* kernel module loader fixup */
 	/* so we don't try to load run modprobe in kernel space. */
+	oldfs = get_fs();
 	set_fs(USER_DS);
 
 	retval = audit_bprm(bprm);
 	if (retval)
-		return retval;
+		goto out;
 
 	retval = -ENOENT;
 	for (try=0; try<2; try++) {
@@ -1084,7 +1086,7 @@ int search_binary_handler(struct linux_b
 				bprm->file = NULL;
 				current->did_exec = 1;
 				proc_exec_connector(current);
-				return retval;
+				goto out;
 			}
 			read_lock(&binfmt_lock);
 			put_binfmt(fmt);
@@ -1092,7 +1094,7 @@ int search_binary_handler(struct linux_b
 				break;
 			if (!bprm->file) {
 				read_unlock(&binfmt_lock);
-				return retval;
+				goto out;
 			}
 		}
 		read_unlock(&binfmt_lock);
@@ -1110,6 +1112,8 @@ int search_binary_handler(struct linux_b
 #endif
 		}
 	}
+out:
+	set_fs(oldfs);
 	return retval;
 }
 
_

Patches currently in -mm which might be from dmonakhov@openvz.org are

broadcom-4400-resume-small-fix-v2.patch
mm-search_binary_handler-mem-limit-fix.patch

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

end of thread, other threads:[~2007-01-30 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-24  9:09 + mm-search_binary_handler-mem-limit-fix.patch added to -mm tree akpm
2007-01-29 11:33 ` Heiko Carstens
2007-01-29 13:59   ` Heiko Carstens
2007-01-29 17:37     ` Andrew Morton
2007-01-29 18:18       ` Martin Schwidefsky
2007-01-30  5:40         ` Dmitriy Monakhov
2007-01-30 12:23           ` Martin Schwidefsky

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.