linux-hardened/arch
Lennert Buytenhek 06c67befee [PATCH] make valid_mmap_phys_addr_range() take a pfn
Newer ARMs have a 40 bit physical address space, but mapping physical
memory above 4G needs a special page table format which we (currently?) do
not use for userspace mappings, so what happens instead is that mapping an
address >= 4G will happily discard the upper bits and wrap.

There is a valid_mmap_phys_addr_range() arch hook where we could check for
>= 4G addresses and deny the mapping, but this hook takes an unsigned long
address:

	static inline int valid_mmap_phys_addr_range(unsigned long addr, size_t size);

And drivers/char/mem.c:mmap_mem() calls it like this:

	static int mmap_mem(struct file * file, struct vm_area_struct * vma)
	{
		size_t size = vma->vm_end - vma->vm_start;

		if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size))

So that's not much help either.

This patch makes the hook take a pfn instead of a phys address.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:25 -07:00
..
alpha [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
arm [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
arm26 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
cris [PATCH] pcf8563: remove MOD_INC_USE_COUNT, MOD_DEC_USE_COUNT 2006-07-10 13:24:22 -07:00
frv [PATCH] FRV: Introduce asm-offsets for FRV arch 2006-07-10 13:24:22 -07:00
h8300 [PATCH] irq-flags: H8300: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
i386 [PATCH] get_cmos_time() locking fix (lockdep) 2006-07-10 13:24:22 -07:00
ia64 [PATCH] make valid_mmap_phys_addr_range() take a pfn 2006-07-10 13:24:25 -07:00
m32r [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
m68k [PATCH] irq-flags: M68K: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
m68knommu [PATCH] irq-flags: M68KNOMMU: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
mips [PATCH] FDPIC: Move roundup() into linux/kernel.h 2006-07-10 13:24:22 -07:00
parisc [PATCH] vt: Remove VT-specific declarations and definitions from tty.h 2006-07-10 13:24:16 -07:00
powerpc [PATCH] powermac: Combined fixes for backlight code 2006-07-10 13:24:20 -07:00
ppc [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
s390 [PATCH] lockdep: irqtrace subsystem, move account_system_vtime() calls into kernel/softirq.c 2006-07-03 15:27:10 -07:00
sh [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
sh64 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
sparc [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
sparc64 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
um [PATCH] uml: make mconsole version requests happen in a process 2006-07-10 13:24:24 -07:00
v850 [PATCH] irq-flags: V850: Use the new IRQF_ constants 2006-07-02 13:58:48 -07:00
x86_64 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
xtensa [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00