public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix bogon in /dev/mem mmap'ing on nommu
@ 2007-04-12  1:41 Benjamin Herrenschmidt
  2007-04-12 10:40 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2007-04-12  1:41 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Howells, Linux Kernel list, Greg KH

While digging through my MAP_FIXED changes, I found that rather obvious
bug in /dev/mem mmap implementation for nommu archs. get_unmapped_area()
is expected to return an address, not a pfn.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

I suppose that can go in anytime, and probably in stable too, Dave ?

Index: linux-cell/drivers/char/mem.c
===================================================================
--- linux-cell.orig/drivers/char/mem.c	2007-02-12 10:36:14.000000000 +1100
+++ linux-cell/drivers/char/mem.c	2007-04-12 11:38:44.000000000 +1000
@@ -248,7 +248,7 @@ static unsigned long get_unmapped_area_m
 {
 	if (!valid_mmap_phys_addr_range(pgoff, len))
 		return (unsigned long) -EINVAL;
-	return pgoff;
+	return pgoff << PAGE_SHIFT;
 }
 
 /* can't do an in-place private mapping if there's no MMU */



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix bogon in /dev/mem mmap'ing on nommu
  2007-04-12  1:41 [PATCH] fix bogon in /dev/mem mmap'ing on nommu Benjamin Herrenschmidt
@ 2007-04-12 10:40 ` David Howells
  0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2007-04-12 10:40 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Andrew Morton, Linux Kernel list, Greg KH

Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> While digging through my MAP_FIXED changes, I found that rather obvious
> bug in /dev/mem mmap implementation for nommu archs. get_unmapped_area()
> is expected to return an address, not a pfn.

Acked-By: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-12 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-12  1:41 [PATCH] fix bogon in /dev/mem mmap'ing on nommu Benjamin Herrenschmidt
2007-04-12 10:40 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox