From: Hugh Dickins <hugh@veritas.com>
To: bonzini@gnu.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
bugme-daemon@bugzilla.kernel.org, linux-mm@kvack.org
Subject: Re: [Bug 9138] New: kernel overwrites MAP_PRIVATE mmap
Date: Tue, 9 Oct 2007 17:25:39 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0710091711450.30785@blonde.wat.veritas.com> (raw)
In-Reply-To: <470BA58F.8050907@lu.unisi.ch>
On Tue, 9 Oct 2007, Paolo Bonzini wrote:
> > So can you confirm that this behaviour was not present in 2.6.8 but is
> > present in 2.6.20?
>
> Yes. I also have access to a Debian i686 2.6.22.9 and it shows the bug.
That's surprising, and sounds like a bug in 2.6.8 not in 2.6.20 or 2.6.22.
I may have misunderstood the steps, but you summarize:
> I believe the reason is a bad interaction between the private mmap
> established in save.c:
>
> buf = mmap (NULL, file_size, PROT_READ, MAP_PRIVATE, imageFd, 0);
>
> and truncating the inode on which the mmap was done.
It is standard behaviour that truncating the inode on which an mmap
was done will generate SIGBUS on access to pages of the mmap beyond
the new end of file. Easier to understand when MAP_SHARED, but even
when MAP_PRIVATE, and even when private pages have already been
C-O-Wed from the file.
Checking with SUSv3, I find it using the word "may" a lot, without
explicitly demanding this behaviour; but my recollection of the early
implementations of mmap in UNIX, which set the standard, is that they
behaved in this way - though I've often (like you) wished they did not.
Might it have been a different version of Smalltalk which was tested
with the 2.6.8 kernel, a version which didn't cause this to happen?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-10-09 16:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-9138-27@http.bugzilla.kernel.org/>
2007-10-09 15:39 ` Andrew Morton
2007-10-09 16:00 ` Paolo Bonzini
2007-10-09 16:25 ` Hugh Dickins [this message]
2007-10-10 4:42 ` Paolo Bonzini
2007-10-09 16:56 ` Paolo Bonzini
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=Pine.LNX.4.64.0710091711450.30785@blonde.wat.veritas.com \
--to=hugh@veritas.com \
--cc=akpm@linux-foundation.org \
--cc=bonzini@gnu.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=linux-mm@kvack.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