linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Dmitry Safonov <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com,
	mingo@kernel.org, dsafonov@virtuozzo.com, luto@kernel.org
Subject: [tip:x86/vdso] x86/vdso: Unmap vdso blob on vvar mapping failure
Date: Wed, 14 Sep 2016 12:33:51 -0700	[thread overview]
Message-ID: <tip-e38447ee1f487eaccdbef4a61dc064f4ae94e2fa@git.kernel.org> (raw)
In-Reply-To: <20160905133308.28234-2-dsafonov@virtuozzo.com>

Commit-ID:  e38447ee1f487eaccdbef4a61dc064f4ae94e2fa
Gitweb:     http://git.kernel.org/tip/e38447ee1f487eaccdbef4a61dc064f4ae94e2fa
Author:     Dmitry Safonov <dsafonov@virtuozzo.com>
AuthorDate: Mon, 5 Sep 2016 16:33:03 +0300
Committer:  Thomas Gleixner <tglx@linutronix.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@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 | 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;

  reply	other threads:[~2016-09-14 19:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 13:33 [PATCHv5 0/6] x86: 32-bit compatible C/R on x86_64 Dmitry Safonov
2016-09-05 13:33 ` [PATCHv5 1/6] x86/vdso: unmap vdso blob on vvar mapping failure Dmitry Safonov
2016-09-14 19:33   ` tip-bot for Dmitry Safonov [this message]
2016-09-05 13:33 ` [PATCHv5 2/6] x86/vdso: replace calculate_addr in map_vdso() with addr Dmitry Safonov
2016-09-14 19:34   ` [tip:x86/vdso] x86/vdso: Replace " tip-bot for Dmitry Safonov
2016-09-05 13:33 ` [PATCHv5 3/6] x86/arch_prctl/vdso: add ARCH_MAP_VDSO_* Dmitry Safonov
2016-09-05 17:01   ` Andy Lutomirski
2016-09-14 19:34   ` [tip:x86/vdso] x86/arch_prctl/vdso: Add ARCH_MAP_VDSO_* tip-bot for Dmitry Safonov
2016-10-26 12:30     ` Paul Bolle
2016-10-26 12:49       ` Dmitry Safonov
2016-09-05 13:33 ` [PATCHv5 4/6] x86/coredump: use pr_reg size, rather that TIF_IA32 flag Dmitry Safonov
2016-09-14 19:35   ` [tip:x86/vdso] x86/coredump: Use " tip-bot for Dmitry Safonov
2016-09-05 13:33 ` [PATCHv5 5/6] x86/ptrace: down with test_thread_flag(TIF_IA32) Dmitry Safonov
2016-09-14 19:35   ` [tip:x86/vdso] x86/ptrace: Down " tip-bot for Dmitry Safonov
2016-09-05 13:33 ` [PATCHv5 6/6] x86/signal: add SA_{X32,IA32}_ABI sa_flags Dmitry Safonov
2016-09-14 19:36   ` [tip:x86/vdso] x86/signal: Add " tip-bot for Dmitry Safonov
2016-09-14 15:56 ` [PATCHv5 0/6] x86: 32-bit compatible C/R on x86_64 Dmitry Safonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-e38447ee1f487eaccdbef4a61dc064f4ae94e2fa@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).