lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 14 Sep 2016 12:33:51 -0700
From:   tip-bot for Dmitry Safonov <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, tglx@...utronix.de, hpa@...or.com,
        mingo@...nel.org, dsafonov@...tuozzo.com, luto@...nel.org
Subject: [tip:x86/vdso] x86/vdso: Unmap vdso blob on vvar mapping failure

Commit-ID:  e38447ee1f487eaccdbef4a61dc064f4ae94e2fa
Gitweb:     http://git.kernel.org/tip/e38447ee1f487eaccdbef4a61dc064f4ae94e2fa
Author:     Dmitry Safonov <dsafonov@...tuozzo.com>
AuthorDate: Mon, 5 Sep 2016 16:33:03 +0300
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 14 Sep 2016 21:28:08 +0200

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 <dsafonov@...tuozzo.com>
Acked-by: Andy Lutomirski <luto@...nel.org>
Cc: 0x7f454c46@...il.com
Cc: oleg@...hat.com
Cc: linux-mm@...ck.org
Cc: gorcunov@...nvz.org
Cc: xemul@...tuozzo.com
Link: http://lkml.kernel.org/r/20160905133308.28234-2-dsafonov@virtuozzo.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>

---
 arch/x86/entry/vdso/vma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index f840766..3bab6ba 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;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ