提交 9ae3ae0b 编写于 作者: A Alexandre Rusev 提交者: Russell King

[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: NAlexandre Rusev <arusev@ru.mvista.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 c710e39c
......@@ -120,6 +120,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
*/
int valid_phys_addr_range(unsigned long addr, size_t size)
{
if (addr < PHYS_OFFSET)
return 0;
if (addr + size > __pa(high_memory))
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册