Skip to content

Commit

Permalink
x86, vdso: Fix size of get_unmapped_area()
Browse files Browse the repository at this point in the history
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 <stefani@seibold.net>
Cc: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/1395592694-20571-1-git-send-email-stefani@seibold.net
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
  • Loading branch information
Stefani Seibold authored and H. Peter Anvin committed Mar 24, 2014
1 parent 3c1b63b commit 645a387
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/x86/vdso/vdso32-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 645a387

Please sign in to comment.