[PATCH] x86,vdso: Fix an OOPS accessing the hpet mapping w/o an hpet

From: Andy Lutomirski
Date: Wed May 14 2014 - 19:01:40 EST


The access should fail, but it shouldn't oops.

Reported-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
---

This applies to tip/x86/vdso and should be applied to unbreak Trinity
on linux-next.

arch/x86/vdso/vma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index e915eae..d02131e 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -84,6 +84,8 @@ static unsigned long vdso_addr(unsigned long start, unsigned len)
return addr;
}

+static struct page *no_pages[] = {NULL};
+
static int map_vdso(const struct vdso_image *image, bool calculate_addr)
{
struct mm_struct *mm = current->mm;
@@ -125,7 +127,7 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
addr + image->size,
image->sym_end_mapping - image->size,
VM_READ,
- NULL);
+ no_pages);

if (IS_ERR(vma)) {
ret = PTR_ERR(vma);
--
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/