Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7828bbd authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

[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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9e78a13b
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -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;