diff options
author | Alexandre Rusev <arusev@ru.mvista.com> | 2008-02-26 12:42:10 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-29 17:47:20 -0500 |
commit | 9ae3ae0bebb9a3a348dc233229008b126014889d (patch) | |
tree | 84d6277d5e84576cc47fd815828352de99d3068f /arch/arm/mm/mmap.c | |
parent | c710e39cbec4f3d60acd07f5356404a61bc1959a (diff) |
[ARM] 4839/1: fixes kernel Oops in /dev/mem device driver for memory map with PHYS_OFF
"cat /dev/mem" may cause kernel Oops for boards with PHYS_OFFSET != 0
because character device is mapped to addresses starting from zero
and there is no protection against such situation.
Patch just add this.
Signed-off-by: Alexandre Rusev <arusev@ru.mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmap.c')
-rw-r--r-- | arch/arm/mm/mmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index 2728b0e7d2bb..3f6dc40b8353 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -120,6 +120,8 @@ full_search: | |||
120 | */ | 120 | */ |
121 | int valid_phys_addr_range(unsigned long addr, size_t size) | 121 | int valid_phys_addr_range(unsigned long addr, size_t size) |
122 | { | 122 | { |
123 | if (addr < PHYS_OFFSET) | ||
124 | return 0; | ||
123 | if (addr + size > __pa(high_memory)) | 125 | if (addr + size > __pa(high_memory)) |
124 | return 0; | 126 | return 0; |
125 | 127 | ||