提交 e7828bbd 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

[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: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 9e78a13b
...@@ -203,7 +203,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) ...@@ -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) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册