]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86/vdso: Unmap vdso blob on vvar mapping failure
authorDmitry Safonov <dsafonov@virtuozzo.com>
Mon, 5 Sep 2016 13:33:03 +0000 (16:33 +0300)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 14 Sep 2016 19:28:08 +0000 (21:28 +0200)
If remapping of vDSO blob failed on vvar mapping,
we need to unmap previously mapped vDSO blob.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: 0x7f454c46@gmail.com
Cc: oleg@redhat.com
Cc: linux-mm@kvack.org
Cc: gorcunov@openvz.org
Cc: xemul@virtuozzo.com
Link: http://lkml.kernel.org/r/20160905133308.28234-2-dsafonov@virtuozzo.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/entry/vdso/vma.c

index f840766659a8f4fc2c68d778c7b495ad9b40cf98..3bab6ba3ffc50f6e465b58f3870aeb9be67a8ec1 100644 (file)
@@ -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;