From: "Ulrich Drepper" <drepper@gmail.com>
To: "Arjan van de Ven" <arjan@infradead.org>
Cc: "Jason Baron" <jbaron@redhat.com>,
akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: make PROT_WRITE imply PROT_READ
Date: Sat, 24 Jun 2006 11:45:40 -0700 [thread overview]
Message-ID: <a36005b50606241145q4d1dd17dg85f80e07fb582cdb@mail.gmail.com> (raw)
In-Reply-To: <1151072280.3204.17.camel@laptopd505.fenrus.org>
On 6/23/06, Arjan van de Ven <arjan@infradead.org> wrote:
> you ask for it, and the kernel is supposed to deliver the best behavior
> it can.
The kernel should provide
- a stable, reliable interface
- a consistent interface at least accross architectures, maybe even platforms
Providing write-only support for memory falls into none of these
categories. When Jason and I discussed this my position actually was
to disallow PROT_WRITE without PROT_READ completely, making it an
error of mmap and mprotect. That's perfectly legal according to POSIX
and it will teach those who write broken code like this.
Jason's proposal to implicitly set PROT_READ is the second best
solution. It gets rid of the error cases which a developer might not
notice, either because of lucky circumstances or details of the
architecture.
The reality is that almost no platform can really implement write-only
memory. RISC architectures implement sub-word write as word reads,
modify, word write. And even for CISC archs the compiler, for
instance, might decide to read memory, be it for prefetching or
explicit write-combining.
I'm strongly in favor of adding of adding one of the two possible
patches (forbidding, implicitly setting PROT_READ). This will help
preventing these kinds of programming mistakes from spreading and we
already _know_ that there are such programs out there.
next prev parent reply other threads:[~2006-06-24 18:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.PuMM6IwflUYh1MWILO9rb6z4fvY@ifi.uio.no>
2006-06-23 1:24 ` Robert Hancock
2006-06-23 13:39 ` Jason Baron
2006-06-23 14:06 ` Arjan van de Ven
2006-06-23 14:05 ` Jason Baron
2006-06-23 14:18 ` Arjan van de Ven
2006-06-24 18:45 ` Ulrich Drepper [this message]
2006-06-27 9:56 ` Pavel Machek
2006-06-27 12:18 ` Arjan van de Ven
2006-06-28 16:43 ` Ulrich Drepper
2006-06-28 19:49 ` Pavel Machek
2006-06-28 20:05 ` Chase Venters
2006-06-28 23:47 ` Ulrich Drepper
2006-06-29 7:30 ` Pavel Machek
2006-06-29 11:58 ` Alan Cox
2006-06-29 17:20 ` Pavel Machek
2006-06-29 21:00 ` Jason Baron
2006-07-07 2:05 ` Jason Baron
2006-06-30 3:49 ` Ulrich Drepper
2006-06-29 8:15 ` Arjan van de Ven
2006-06-30 3:48 ` Ulrich Drepper
2006-06-30 8:35 ` Arjan van de Ven
2006-06-30 12:20 ` Alan Cox
[not found] <6qIEW-1Tx-23@gated-at.bofh.it>
[not found] ` <6qIEW-1Tx-21@gated-at.bofh.it>
[not found] ` <6qUwd-2Aq-9@gated-at.bofh.it>
[not found] ` <6qUwd-2Aq-7@gated-at.bofh.it>
[not found] ` <6qUFV-2N8-13@gated-at.bofh.it>
[not found] ` <6qUFY-2N8-33@gated-at.bofh.it>
[not found] ` <6rlmT-8op-37@gated-at.bofh.it>
[not found] ` <6siwJ-3dC-5@gated-at.bofh.it>
[not found] ` <6sLoY-4GV-31@gated-at.bofh.it>
[not found] ` <6sZUS-V5-19@gated-at.bofh.it>
[not found] ` <6tib4-2wA-3@gated-at.bofh.it>
[not found] ` <6tmHL-Oq-5@gated-at.bofh.it>
[not found] ` <6tpZ7-5Tj-13@gated-at.bofh.it>
2006-07-01 13:19 ` Bodo Eggert
2006-07-02 9:56 ` Alan Cox
2006-07-02 22:04 ` Bodo Eggert
2006-06-22 17:33 Jason Baron
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=a36005b50606241145q4d1dd17dg85f80e07fb582cdb@mail.gmail.com \
--to=drepper@gmail.com \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=jbaron@redhat.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
all inboxes | Powered by JetHome®