From: Stefani Seibold Date: Sun, 23 Mar 2014 16:38:14 +0000 (+0100) Subject: x86, vdso: Fix size of get_unmapped_area() X-Git-Tag: v3.15-rc1~129^2~3 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=645a387ecbdb4aa78c8451a66416340616134537;p=linux.git x86, vdso: Fix size of get_unmapped_area() The size of the reserved memory for a 32 bit vdso must be the size of the 32 bit vDSO in pages + HPET page + VVAR page. One page is not enough for this. Grrrr.... silly copy and paste bug, was right in previous patch. Signed-off-by: Stefani Seibold Cc: Andy Lutomirski Link: http://lkml.kernel.org/r/1395592694-20571-1-git-send-email-stefani@seibold.net Signed-off-by: H. Peter Anvin --- diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 791c1cb822c6..00348980a3a6 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c @@ -165,12 +165,14 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) down_write(&mm->mmap_sem); - addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0); + addr = get_unmapped_area(NULL, 0, vdso32_size + VDSO_OFFSET(VDSO_PREV_PAGES), 0, 0); if (IS_ERR_VALUE(addr)) { ret = addr; goto up_fail; } + addr += VDSO_OFFSET(VDSO_PREV_PAGES); + current->mm->context.vdso = (void *)addr; /*