From: Jamie Lokier <jamie@shareable.org>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: William Lee Irwin III <wli@holomorphy.com>,
Michael Kerrisk <michael.kerrisk@gmx.net>,
linux-kernel@vger.kernel.org
Subject: Re: Testing PROT_NONE and other protections, and a surprise
Date: Thu, 1 Jul 2004 13:39:41 +0100 [thread overview]
Message-ID: <20040701123941.GC4187@mail.shareable.org> (raw)
In-Reply-To: <736E7483-CB1B-11D8-947A-000393ACC76E@mac.com>
Kyle Moffett wrote:
> >Can you confirm in a simple way that mapping a file, or some anonymous
> >memory, without PROT_READ, really isn't writable under MacOS X? Can
> >you confirm it with a word write, if that would be relevant?
>
> I hope I didn't make some stupid mistake in my program, but here it
> is, and here are my results.
Thanks for testing, Kyle.
It looks fine, although this is wrong:
> mem = mmap(0,4096,PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
> ...
> if (mem == 0) return 1;
The error code is -1, aka. MAP_FAILED.
> Starting...
> Mapped memory!
> Address is 4000
That's a surprisingly low address.
> Bus error
Phew, I'm glad I decided to catch SIGBUS in the test program at the
last moment...
That's a historical BSD-ism. They can't change it now, because
programs do trap and check for SIGBUS on that platform for protection
violations.
> I'll probably go file a bug with Apple now :-D
It might be a generic *BSD bug (for whatever value of * is used by MacOS X).
That would be interesting to know -- anyone here running *BSD on PPC
or any other architecture to test?
Of course it's an Apple bug as well :)
-- Jamie
next prev parent reply other threads:[~2004-07-01 12:40 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 2:44 A question about PROT_NONE on ARM and ARM26 Jamie Lokier
2004-06-30 3:38 ` William Lee Irwin III
2004-07-01 3:26 ` Testing PROT_NONE and other protections, and a surprise Jamie Lokier
2004-07-01 3:35 ` William Lee Irwin III
2004-07-01 4:01 ` Jamie Lokier
2004-07-01 3:44 ` Kyle Moffett
2004-07-01 4:11 ` Jamie Lokier
2004-07-01 4:59 ` Kyle Moffett
2004-07-01 12:39 ` Jamie Lokier [this message]
2004-07-01 14:43 ` [OT] " Kyle Moffett
2004-07-01 14:50 ` Jamie Lokier
2004-07-01 15:01 ` Kyle Moffett
2004-07-01 16:37 ` Matt Mackall
2004-07-01 17:26 ` Michael Driscoll
2004-07-02 7:37 ` Gabriel Paubert
2004-07-01 12:52 ` Russell King
2004-07-01 14:26 ` Richard Curnow
2004-06-30 8:16 ` A question about PROT_NONE on ARM and ARM26 Russell King
2004-06-30 14:59 ` Jamie Lokier
2004-06-30 15:22 ` Ian Molton
2004-06-30 18:26 ` Russell King
2004-06-30 19:14 ` Jamie Lokier
2004-06-30 19:23 ` Russell King
2004-06-30 20:15 ` Jamie Lokier
2004-06-30 22:59 ` Russell King
2004-06-30 23:30 ` Jamie Lokier
2004-06-30 23:48 ` Ian Molton
2004-07-01 1:59 ` Jamie Lokier
2004-07-01 1:05 ` Nicolas Pitre
2004-07-01 1:50 ` Jamie Lokier
2004-07-02 18:39 ` Russell King
2004-07-01 15:27 ` Scott Wood
2004-07-01 23:53 ` Jamie Lokier
2004-07-02 14:36 ` Scott Wood
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=20040701123941.GC4187@mail.shareable.org \
--to=jamie@shareable.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.kerrisk@gmx.net \
--cc=mrmacman_g4@mac.com \
--cc=wli@holomorphy.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