public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Jamie Lokier <jamie@shareable.org>
Cc: Ian Molton <spyro@f2s.com>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-kernel@vger.kernel.org
Subject: Re: A question about PROT_NONE on ARM and ARM26
Date: Wed, 30 Jun 2004 20:23:13 +0100	[thread overview]
Message-ID: <20040630202313.A1496@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20040630191428.GC31064@mail.shareable.org>; from jamie@shareable.org on Wed, Jun 30, 2004 at 08:14:28PM +0100

On Wed, Jun 30, 2004 at 08:14:28PM +0100, Jamie Lokier wrote:
> Russell King wrote:
> > We use three domains - one for user, one for kernel and one for IO.
> > Normally all three are in client mode.  However, on set_fs(KERNEL_DS)
> > we switch the kernel domain to manager mode.
> > 
> > This means that the user-mode LDR instructions (ldrt / ldrlst etc)
> > will not have their page permissions checked, and therefore the access
> > will succeed - exactly as we require.
> 
> Protection permissions (i.e. read-only, PROT_NONE) should still be
> checked after set_fs(KERNEL_DS).  It's only the kernel page vs. user
> page distinction that should be relaxed.
> 
> >From your description, it's not obvious that it'll do the right thing
> in that circumstance.

Trust me, it does.  Unless you fully understand how the MMU and domains
work on ARM, you've little chance of working it out from the code.

Really, I see its pointless trying to discuss the details of this any
further - I presently have very little time to educate people in the
details, sorry.

> Because set_fs() is rarely used, I think you can optimise getuser.S
> and putuser.S on ARM26.  Instead of comparing the address against
> TI_ADDR_LIMIT, compare it against the hard-coded userspace limit.

Wrong.  That means that if userspace passes an address above the hard
coded limit, we _WILL_ bypass all protections and access that memory.

However, ARM26 is not under my control anymore, so it isn't something
I care about, and I doubt there are many people who do.  We're talking
about a 20 year old architecture which hasn't had any conforming devices
produced for at least 10 years.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2004-06-30 19:23 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
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 [this message]
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=20040630202313.A1496@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=jamie@shareable.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spyro@f2s.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