mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-kernel@vger.kernel.org,
	William Lee Irwin III <wli@holomorphy.com>,
	Michael Kerrisk <michael.kerrisk@gmx.net>
Subject: Re: Table of mmap PROT_* implementations by architecture
Date: Tue, 6 Jul 2004 14:28:30 -0700	[thread overview]
Message-ID: <16619.6526.367058.311714@napali.hpl.hp.com> (raw)
In-Reply-To: <20040701033620.GB1564@mail.shareable.org>

>>>>> On Thu, 1 Jul 2004 04:36:20 +0100, Jamie Lokier <jamie@shareable.org> said:

  >> From a study of Linux 2.6.5 source code, and some patches.
  Jamie> This is based on studying the source, not running tests, so
  Jamie> there may be errors.

  Jamie> This table shows expected page protections, for different
  Jamie> values of PROT_READ, PROT_WRITE and PROT_EXEC passed to
  Jamie> mmap() and mprotect().

  Jamie> (As noted in a recent mail from me, real behaviour isn't
  Jamie> quite this simple.  Reading from a write-only page will
  Jamie> *sometimes* raise a signal, and sometimes not, possibly
  Jamie> dependent on background paging decisions.  Therefore some of
  Jamie> these entries should say "!w!" instead of "rwx", and "!w-"
  Jamie> instead of "rw-".  Perhaps there are other combinations too,
  Jamie> depending on architecture-specific fault handlers).


  Jamie> ==============================================================
  Jamie> Requested PROT flags | --- R-- -W- RW- --X    R-X -WX RWX
  Jamie> ==============================================================
  Jamie> ia64                 | --- r-- rw- rw- --x(1) r-x rwx rwx
  Jamie> --------------------------------------------------------------

  Jamie> (1) - In kernel, maybe these pages are readable using
  Jamie> "write()"?

That's correct for ia64.  The architecture does not support an
"execute-only at all privilege levels" protection per se, so this
behavior is the easiest (most efficient) to implement.  If we really
cared about the "read execute-only at kernel-level", we could use
"probe" instructions in the __access_ok() macro to verify (user-level)
access permission.

	--david

      parent reply	other threads:[~2004-07-06 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-01  3:36 Jamie Lokier
2004-07-01  3:59 ` Kyle Moffett
2004-07-01  4:04   ` Jamie Lokier
2004-07-06 21:28 ` David Mosberger [this message]

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=16619.6526.367058.311714@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=davidm@hpl.hp.com \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.kerrisk@gmx.net \
    --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

all inboxes | Powered by JetHome®