The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: Florian Heinz <heinz@cronon-ag.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: a.out issue
Date: Thu, 11 Nov 2004 19:27:27 -0800	[thread overview]
Message-ID: <20041111192727.R14339@build.pdx.osdl.net> (raw)
In-Reply-To: <20041111220906.GA1670@dereference.de>; from heinz@cronon-ag.de on Thu, Nov 11, 2004 at 11:09:07PM +0100

* Florian Heinz (heinz@cronon-ag.de) wrote:
> seems like find_vma_prepare does not what insert_vm_struct expects when
> the whole addresspace is occupied.

The setup_arg_pages() is inserting an overlapping region.  If nothing
else, this will fix that problem.   Perhaps there's a better solution.

thanks,
-chris

===== fs/exec.c 1.143 vs edited =====
--- 1.143/fs/exec.c	2004-10-28 00:40:03 -07:00
+++ edited/fs/exec.c	2004-11-11 19:24:54 -08:00
@@ -413,6 +413,7 @@
 
 	down_write(&mm->mmap_sem);
 	{
+		struct vm_area_struct *vma;
 		mpnt->vm_mm = mm;
 #ifdef CONFIG_STACK_GROWSUP
 		mpnt->vm_start = stack_base;
@@ -433,6 +434,12 @@
 			mpnt->vm_flags = VM_STACK_FLAGS;
 		mpnt->vm_flags |= mm->def_flags;
 		mpnt->vm_page_prot = protection_map[mpnt->vm_flags & 0x7];
+		vma = find_vma(mm, mpnt->vm_start);
+		if (vma) {
+			up_write(&mm->mmap_sem);
+			kmem_cache_free(vm_area_cachep, mpnt);
+			return -ENOMEM;
+		}
 		insert_vm_struct(mm, mpnt);
 		mm->stack_vm = mm->total_vm = vma_pages(mpnt);
 	}

  parent reply	other threads:[~2004-11-12  3:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-11 22:09 a.out issue Florian Heinz
2004-11-11 22:23 ` Ed Schouten
2004-11-11 22:29 ` Ed Schouten
2004-11-11 22:32 ` Chris Wright
2004-11-11 23:05   ` Ed Schouten
2004-11-11 23:31     ` Chris Wright
2004-11-12  0:11 ` Kurt Wall
2004-11-12  3:27 ` Chris Wright [this message]
2004-11-12  3:51   ` Kurt Wall
2004-11-12  7:15     ` Chris Wright

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=20041111192727.R14339@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=heinz@cronon-ag.de \
    --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