aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Safonov <[email protected]>2016-09-05 16:33:03 +0300
committerThomas Gleixner <[email protected]>2016-09-14 21:28:08 +0200
commite38447ee1f487eaccdbef4a61dc064f4ae94e2fa (patch)
tree2ae3bbee91a141530c1787d74cc683b5e7fab678
parent9395452b4aab7bc2475ef8935b4a4fb99d778d70 (diff)
x86/vdso: Unmap vdso blob on vvar mapping failure
If remapping of vDSO blob failed on vvar mapping, we need to unmap previously mapped vDSO blob. Signed-off-by: Dmitry Safonov <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
-rw-r--r--arch/x86/entry/vdso/vma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index f840766659a8..3bab6ba3ffc5 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -238,12 +238,14 @@ static int map_vdso(const struct vdso_image *image, bool calculate_addr)
if (IS_ERR(vma)) {
ret = PTR_ERR(vma);
- goto up_fail;
+ do_munmap(mm, text_start, image->size);
}
up_fail:
- if (ret)
+ if (ret) {
current->mm->context.vdso = NULL;
+ current->mm->context.vdso_image = NULL;
+ }
up_write(&mm->mmap_sem);
return ret;