fix bogon in /dev/mem mmap'ing on nommu
PATCH 1/1 fix bogon in /dev/mem mmap'ing on nommu
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 <[email protected]>
---
I suppose that can go in anytime, and probably in stable too, Dave ?
drivers/char/mem.c +1 -1
@@ -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 */
Quoted 3 lines · Benjamin Herrenschmidt
While digging through my
MAP_FIXEDchanges, I found that rather obvious bug in/dev/memmmap implementation for nommu archs.get_unmapped_area()is expected to return an address, not a pfn.
Acked-by David Howells <[email protected]>