public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Tony Luck <tony.luck@intel.com>,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH] /dev/mem validate mmap requests
Date: Tue, 06 Dec 2005 20:49:11 +0000	[thread overview]
Message-ID: <200512061349.11895.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0512061832090.26899@goblin.wat.veritas.com>

On Tuesday 06 December 2005 11:39 am, Hugh Dickins wrote:
> On Mon, 5 Dec 2005, Bjorn Helgaas wrote:
> > Add a hook so architectures can validate /dev/mem mmap requests.
> 
> Not a comment on your patch at all, just an FYI in case you've missed
> it, and in case it makes any difference to your ia64 needs.
> 
> A side-effect of 2.6.15-rc's PageReserved changes is that a user with
> access to /dev/mem can now mmap any page of it, and see what's there
> rather than zeroes, whether or not it has been marked PageReserved.

Thanks for the pointer.

I think my patch is orthogonal to your PageReserved changes.

Here's a little more detail on the problem scenario.  An HP
sx1000 machine with VGA has a memory map like this:

	0-640K 		memory (supports only WB mappings)
	640K-768K	VGA frame buffer (MMIO, supports only UC mappings)
	768K-16M	memory (supports only WB mappings)

We use a 16MB "granule".  All mappings within a granule have to
be the same type to avoid attribute aliasing.  Since we're using
VGA, we have to use UC mappings for the MMIO frame buffer.  We
can't use UC mappings for the memory, because the sx1000 chipset
doesn't support that.  We can't use WB mappings, because that would
cause attribute aliasing.

Since we can't use WB mappings, the kernel ignores all that memory
between 0-16MB.  There aren't even any page structures for it.  But
without my patch, /dev/mem allows users to mmap it.  And there's no
safe way to allow access of any kind to that memory.

Bjorn

      reply	other threads:[~2005-12-06 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-06  0:00 [PATCH] /dev/mem validate mmap requests Bjorn Helgaas
2005-12-06 18:39 ` Hugh Dickins
2005-12-06 20:49   ` Bjorn Helgaas [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=200512061349.11895.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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