summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authoramateur <tianlei.zhao@gmail.com>2010-09-14 13:22:34 +0800
committerRiku Voipio <riku.voipio@nokia.com>2010-12-03 15:09:38 +0200
commit85519c26ba30209a9ab0144924f4ef03412354ed (patch)
treed95b90fb8d6a1338ba117ec544be5c71099c27f5 /linux-user
parent1e3f9a9e927b7b1d3a935d958c9b2053c9679693 (diff)
downloadqemu-85519c26ba30209a9ab0144924f4ef03412354ed.tar.gz
qemu-85519c26ba30209a9ab0144924f4ef03412354ed.tar.bz2
qemu-85519c26ba30209a9ab0144924f4ef03412354ed.zip
linux-user: mmap_reserve() not controlled by RESERVED_VA
mmap_reserve() should be called only when RESERVED_VA is enabled. Otherwise, unmaped virtual address space will never be reusable. This bug will exhaust virtual address space in extreme conditions. Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/mmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 035dfbd076..abf21f6064 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -697,7 +697,9 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
old_size, new_size,
flags | MREMAP_FIXED,
g2h(mmap_start));
- mmap_reserve(old_addr, old_size);
+ if ( RESERVED_VA ) {
+ mmap_reserve(old_addr, old_size);
+ }
}
} else {
int prot = 0;