Skip to contentSkip to conversation

mm-search_binary_handler-mem-limit-fix is horribly broken

PATCH Jeff Dike 1 participant 1 message Jan 31, 2007

Subsystems (2)
lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

It works on i386 only by accident, and doesn't work at all with UML.

start_thread, which is called from inside the set_fs(USER_DS) - set_fs(oldfs) does set_fs(USER_DS). That is then blown away by the set_fs(oldfs).

A one-line fix might be

fs/exec.c 2007-01-31 12:41:15.000000000 -0500 renamed from fs/exec.c 2007-01-31 12:10:08.000000000 -0500 +1 -0
Index: linux-2.6.17/fs/exec.c
===================================================================
@@ -1079,6 +1079,7 @@ int search_binary_handler(struct linux_b
                                continue;
                        read_unlock(&binfmt_lock);
                        retval = fn(bprm, regs);
+                       oldfs = get_fs();
                        if (retval >= 0) {
                                put_binfmt(fmt);
                                allow_write_access(bprm->file);

but this seems like it's pasting one kludge on top of another.

Jeff

Signature · 1 line
Work email - jdike at linux dot intel dot com