[S390] vdso: dont map at mmap_base

The vdso object is currently always mapped with mm->mmap_base used as
requested address. In case of flexible mmap layout this means it gets
mapped above mmap_base and therefore potentially stealing a bit of
address space that is reserved for the stack.
In case of flexible mmap layout the object should be mapped below
mmap base. For legacy mmap layout above.
To fix this just don't request any specific address and let the mmap
code figure out an address that fits.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Heiko Carstens 2011-01-12 09:55:24 +01:00 committed by Martin Schwidefsky
parent 9e78a13bfb
commit e7828bbd5e

View file

@ -203,7 +203,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
if (!uses_interp) if (!uses_interp)
return 0; return 0;
vdso_base = mm->mmap_base;
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
vdso_pagelist = vdso64_pagelist; vdso_pagelist = vdso64_pagelist;
vdso_pages = vdso64_pages; vdso_pages = vdso64_pages;
@ -233,8 +232,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
* fail and end up putting it elsewhere. * fail and end up putting it elsewhere.
*/ */
down_write(&mm->mmap_sem); down_write(&mm->mmap_sem);
vdso_base = get_unmapped_area(NULL, vdso_base, vdso_base = get_unmapped_area(NULL, 0, vdso_pages << PAGE_SHIFT, 0, 0);
vdso_pages << PAGE_SHIFT, 0, 0);
if (IS_ERR_VALUE(vdso_base)) { if (IS_ERR_VALUE(vdso_base)) {
rc = vdso_base; rc = vdso_base;
goto out_up; goto out_up;