public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: 2.4.10 bad ELF kills system bug
Date: Wed, 3 Oct 2001 01:50:25 +0000 (UTC)	[thread overview]
Message-ID: <9pdqt1$2eh$1@penguin.transmeta.com> (raw)
In-Reply-To: <200110030040.f930eF921188@www.hockin.org>

In article <200110030040.f930eF921188@www.hockin.org>,
Tim Hockin  <thockin@hockin.org> wrote:
>I can't believe how nonchalant everyone is about this bug.  Is there a
>definate fix yet?  If so, what is it?  Will there be a rushed 2.4.11, or
>will it languish for a while?

Well, the bug is actually ancient. The fix is something along the lines
of the attached, although there are people with prettier versions
(Andrea is looking at other buglets in the ELF loader).

		Linus

----
--- pre2/linux/fs/binfmt_elf.c	Tue Oct  2 16:24:18 2001
+++ linux/fs/binfmt_elf.c	Tue Oct  2 16:23:33 2001
@@ -298,6 +298,8 @@
 	    	elf_type |= MAP_FIXED;
 
 	    map_addr = elf_map(interpreter, load_addr + vaddr, eppnt, elf_prot, elf_type);
+	    if (map_addr > TASK_SIZE)
+	    	goto out_close;
 
 	    if (!load_addr_set && interp_elf_ex->e_type == ET_DYN) {
 		load_addr = map_addr - ELF_PAGESTART(vaddr);
@@ -649,6 +651,8 @@
 		}
 
 		error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags);
+		if (error > TASK_SIZE)
+			continue;
 
 		if (!load_addr_set) {
 			load_addr_set = 1;


      reply	other threads:[~2001-10-03  1:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-03  0:40 2.4.10 bad ELF kills system bug Tim Hockin
2001-10-03  1:50 ` Linus Torvalds [this message]

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='9pdqt1$2eh$1@penguin.transmeta.com' \
    --to=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox