From c65ffe6d6ca8b156e729e81054ca7597864354a9 Mon Sep 17 00:00:00 2001 From: amateur Date: Tue, 14 Sep 2010 13:22:34 +0800 Subject: 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 --- linux-user/mmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1