All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: unlisted-recipients:; (no To-header on input)
Cc: linux-kernel@vger.kernel.org
Subject: mm-search_binary_handler-mem-limit-fix is horribly broken
Date: Wed, 31 Jan 2007 12:38:06 -0500	[thread overview]
Message-ID: <20070131173656.GA5789@ccure.user-mode-linux.org> (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

Index: linux-2.6.17/fs/exec.c
===================================================================
--- linux-2.6.17.orig/fs/exec.c 2007-01-31 12:10:08.000000000 -0500
+++ linux-2.6.17/fs/exec.c      2007-01-31 12:41:15.000000000 -0500
@@ -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

-- 
Work email - jdike at linux dot intel dot com

                 reply	other threads:[~2007-01-31 17:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070131173656.GA5789@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.