summaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/sysenter.c
diff options
context:
space:
mode:
authorpageexec@freemail.hu2006-06-28 20:44:16 +0200
committerLinus Torvalds2006-06-28 21:05:50 +0200
commit79bc79b07c9c6f8ae9290704e9e503a9327fcbb2 (patch)
tree1e9b72b18d1605e8ea3fe72f9b992867a4697224 /arch/i386/kernel/sysenter.c
parentMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/... (diff)
downloadkernel-qcow2-linux-79bc79b07c9c6f8ae9290704e9e503a9327fcbb2.tar.gz
kernel-qcow2-linux-79bc79b07c9c6f8ae9290704e9e503a9327fcbb2.tar.xz
kernel-qcow2-linux-79bc79b07c9c6f8ae9290704e9e503a9327fcbb2.zip
[PATCH] small fix for not releasing the mmap semaphore in i386/arch_setup_additional_pages
the VDSO randomization code on i386 fails to release the mmap semaphore if insert_vm_struct() fails. [ Made the conditional unlikely. -- Linus ] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/sysenter.c')
-rw-r--r--arch/i386/kernel/sysenter.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index c60419dee018..713ba39d32c6 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -148,8 +148,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
vma->vm_mm = mm;
ret = insert_vm_struct(mm, vma);
- if (ret)
- goto free_vma;
+ if (unlikely(ret)) {
+ kmem_cache_free(vm_area_cachep, vma);
+ goto up_fail;
+ }
current->mm->context.vdso = (void *)addr;
current_thread_info()->sysenter_return =
@@ -158,10 +160,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack)
up_fail:
up_write(&mm->mmap_sem);
return ret;
-
-free_vma:
- kmem_cache_free(vm_area_cachep, vma);
- return ret;
}
const char *arch_vma_name(struct vm_area_struct *vma)