mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: "Martin J. Bligh" <mbligh@aracnet.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>
Subject: Re: 2.6.5-rc1-aa3
Date: Sun, 21 Mar 2004 14:26:30 +0100	[thread overview]
Message-ID: <20040321132630.GO10787@dualathlon.random> (raw)
In-Reply-To: <2910700000.1079849836@[10.10.2.4]>

On Sat, Mar 20, 2004 at 10:17:16PM -0800, Martin J. Bligh wrote:
> > Fixed the sigbus in nopage and improved the page_t layout per Hugh's
> > suggestion. BUG() with discontigmem disabled if somebody returns non-ram
> > via do_no_page, that cannot work right on numa anyways.
> 
> OK, well it doesn't oops any more. But sshd still dies as soon as it starts,
> so accessing the box is tricky ;-) And now I have no obvious diagnostics
> either ...

Jens sent me the perfect strace log, after his help it has not been
difficult to spot the bug. this incremental should fix it
MAP_SHARED|MAP_ANONYMOUS isn't very common and my userspace never
triggered it. I placed the pgoff anon setting in the path of the shared
memory too, that generated the sigbus. Leaving the setting only in the
MAP_PRIVATE should fix it, the anonymous memory is only MAP_PRIVATE.

patch is untested at the moment, as soon as I get confirmation I'll
upload an update.

thanks!

--- x/mm/mmap.c.~1~	2004-03-20 22:12:43.000000000 +0100
+++ x/mm/mmap.c	2004-03-21 14:15:17.269882800 +0100
@@ -622,11 +622,11 @@ unsigned long do_mmap_pgoff(struct file 
 			return -EINVAL;
 		case MAP_PRIVATE:
 			vm_flags &= ~(VM_SHARED | VM_MAYSHARE);
-			/* fall through */
+			pgoff = addr >> PAGE_SHIFT;
+			break;
 		case MAP_SHARED:
 			break;
 		}
-		pgoff = addr >> PAGE_SHIFT;
 	}
 
 	error = security_file_mmap(file, prot, flags);

  parent reply	other threads:[~2004-03-21 13:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-20 21:03 2.6.5-rc1-aa3 Andrea Arcangeli
2004-03-20 22:06 ` 2.6.5-rc1-aa3 Andrew Morton
2004-03-21  6:17 ` 2.6.5-rc1-aa3 Martin J. Bligh
2004-03-21 11:51   ` 2.6.5-rc1-aa3 Andrea Arcangeli
2004-03-21 13:26   ` Andrea Arcangeli [this message]
2004-03-21 16:23     ` 2.6.5-rc1-aa3 Martin J. Bligh
2004-03-21 10:05 ` 2.6.5-rc1-aa3 Marc-Christian Petersen
2004-03-21 11:49   ` do we want to kill VM_RESERVED or not? [was Re: 2.6.5-rc1-aa3] Andrea Arcangeli
2004-03-21 12:00     ` Andrea Arcangeli
2004-03-21 12:15       ` Andrea Arcangeli
2004-03-21 19:42         ` Marc-Christian Petersen
2004-03-22  0:10           ` Andrea Arcangeli
2004-03-22 12:10             ` Marc-Christian Petersen
2004-03-22 12:42               ` Andrea Arcangeli
2004-03-23  9:54                 ` Marc-Christian Petersen
2004-03-21 23:24     ` Andrew Morton
2004-03-22  0:51       ` Andrea Arcangeli

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=20040321132630.GO10787@dualathlon.random \
    --to=andrea@suse.de \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    /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

Powered by JetHome