diff options
author | Dmitry Safonov <dsafonov@virtuozzo.com> | 2016-09-05 09:33:03 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-14 15:28:08 -0400 |
commit | e38447ee1f487eaccdbef4a61dc064f4ae94e2fa (patch) | |
tree | 2ae3bbee91a141530c1787d74cc683b5e7fab678 | |
parent | 9395452b4aab7bc2475ef8935b4a4fb99d778d70 (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 <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>
-rw-r--r-- | arch/x86/entry/vdso/vma.c | 6 |
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) | |||
238 | 238 | ||
239 | if (IS_ERR(vma)) { | 239 | if (IS_ERR(vma)) { |
240 | ret = PTR_ERR(vma); | 240 | ret = PTR_ERR(vma); |
241 | goto up_fail; | 241 | do_munmap(mm, text_start, image->size); |
242 | } | 242 | } |
243 | 243 | ||
244 | up_fail: | 244 | up_fail: |
245 | if (ret) | 245 | if (ret) { |
246 | current->mm->context.vdso = NULL; | 246 | current->mm->context.vdso = NULL; |
247 | current->mm->context.vdso_image = NULL; | ||
248 | } | ||
247 | 249 | ||
248 | up_write(&mm->mmap_sem); | 250 | up_write(&mm->mmap_sem); |
249 | return ret; | 251 | return ret; |