Skip to contentSkip to conversation

x86: unmap vdso pages are missed

PATCH In review Shaohua Li 2 participants 4 messages Jul 30, 2010 – Aug 2, 2010 x86

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 x86: unmap vdso pages are missed

The memory hasn't been unmapped.

arch/x86/vdso/vma.c +1 -0
index ac74869..80f23ed 100644
@@ -67,6 +67,7 @@ static int __init init_vdso_vars(void)
 	*(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
 #include "vextern.h"
 #undef VEXTERN
+	vunmap(vbase);
 	return 0;
 
  oom:
#1 lore raw
Quoted 3 lines · Shaohua Li

The memory hasn't been unmapped.

Looks right, but it would be really good if you could provide a more verbose description about why this is the right thing to do.

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
author
#2 lore raw
Quoted 7 lines · H. Peter Anvin
Quoted 3 lines · Shaohua Li

The memory hasn't been unmapped.

Looks right, but it would be really good if you could provide a more verbose description about why this is the right thing to do.

We mapped vdso pages but never unmapped them and the vitrual address is lost after exitting from the function. So unmap vdso pages here.

arch/x86/vdso/vma.c +1 -0
index ac74869..80f23ed 100644
@@ -67,6 +67,7 @@ static int __init init_vdso_vars(void)
 	*(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
 #include "vextern.h"
 #undef VEXTERN
+	vunmap(vbase);
 	return 0;
 
  oom:
#3 lore raw

[tip:x86/vdso] x86, vdso: Unmap vdso pages

Commit-ID:  be783a47214afc5a0aea9dafcbd9f1535ba05e94
Gitweb:     http://git.kernel.org/tip/be783a47214afc5a0aea9dafcbd9f1535ba05e94
Author:     Shaohua Li <[email protected]>
AuthorDate: Mon, 2 Aug 2010 08:49:34 +0800
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Mon, 2 Aug 2010 15:11:59 -0700

x86, vdso: Unmap vdso pages

We mapped vdso pages but never unmapped them and the virtual address is lost after exiting from the function, so unmap vdso pages here.

LKML-Reference: <[email protected]>

---
 arch/x86/vdso/vma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/vdso/vma.c +1 -0
index ac74869..80f23ed 100644
@@ -67,6 +67,7 @@ static int __init init_vdso_vars(void)
 	*(typeof(__ ## x) **) var_ref(VDSO64_SYMBOL(vbase, x), #x) = &__ ## x;
 #include "vextern.h"
 #undef VEXTERN
+	vunmap(vbase);
 	return 0;
 
  oom: