From: Roland McGrath Date: Wed, 9 Apr 2008 08:30:06 +0000 (-0700) Subject: x86 vDSO: don't map 32-bit vdso when disabled X-Git-Tag: v2.6.26-rc1~1154^2~608 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5de253cc5b1f565f7aeb5bacd67bac37e943ceef;p=linux-2.6 x86 vDSO: don't map 32-bit vdso when disabled We map a VMA for the 32-bit vDSO even when it's disabled, which is stupid. For the 32-bit kernel it's the vdso_enabled boot parameter/sysctl and for the 64-bit kernel it's the vdso32 boot parameter/syscall32 sysctl. When it's disabled, we don't pass AT_SYSINFO_EHDR so processes don't use the vDSO for anything, but we still map it. For the non-compat vDSO, this means we're always putting an extra VMA somewhere, maybe lousing up the control of the address space the user was hoping for. Honor the setting by doing nothing in arch_setup_additional_pages. [ also see: "x86 vDSO: don't use disabled vDSO for signal trampoline" ] Signed-off-by: Roland McGrath Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 348f1341e1..f7e78d84fc 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c @@ -325,6 +325,9 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) int ret = 0; bool compat; + if (vdso_enabled == VDSO_DISABLED) + return 0; + down_write(&mm->mmap_sem); /* Test compat mode once here, in case someone