Commit 79bc79b0 authored by's avatar Committed by Linus Torvalds
Browse files

[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: default avatarLinus Torvalds <>
parent a39727f2
......@@ -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)
return ret;
kmem_cache_free(vm_area_cachep, vma);
return ret;
const char *arch_vma_name(struct vm_area_struct *vma)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment