All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@osdl.org>,
	Segher Boessenkool <segher@kernel.crashing.org>
Subject: Re: [PATCH] Fix bound checking in do_mmap_pgoff()
Date: Sun, 19 Sep 2004 23:09:22 +1000	[thread overview]
Message-ID: <1095599362.18430.4.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.44.0409191330420.13231-100000@localhost.localdomain>

On Sun, 2004-09-19 at 22:59, Hugh Dickins wrote:
> On Sun, 19 Sep 2004, Benjamin Herrenschmidt wrote:
> > 
> > A small issue has been forever in do_mmap_pgoff() in the boundary checking
> > in the sense that it won't let you mmap with offset+len enclosing the last
> > page of the "address space". For example, an mmap of /dev/mem won't let you
> > map the last page of the physical address space (which I need for a ROM dump
> > tool on pmac). This fixes it:
> > -	if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
> > +	if ((pgoff + (len >> PAGE_SHIFT) - 1) < pgoff)
> 
> Your physical address space happens to be 16TB?  Okay...

hrm... nope... my bad, the problem comes from elsewhere, sorry. I need
to look at it again.

> I think you need to add in the patch below, to prevent mismerging of vmas.
> There might be other places which would get confused by an end pgoff of 0.

Ok, that's becoming more tricky then, Andrew, of course drop the bogus
patch for now, I'll look into more details later if I find time. In the
meantime, we'll continue use a special kernel module for doing the
ROM dump.

Ben.
 


      reply	other threads:[~2004-09-19 13:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-19  8:07 [PATCH] Fix bound checking in do_mmap_pgoff() Benjamin Herrenschmidt
2004-09-19 12:59 ` Hugh Dickins
2004-09-19 13:09   ` Benjamin Herrenschmidt [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=1095599362.18430.4.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=segher@kernel.crashing.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.