From patchwork Fri Dec 3 13:36:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02/16] linux-user: mmap_reserve() not controlled by RESERVED_VA From: Riku@afflict.kos.to, Voipio@afflict.kos.to X-Patchwork-Id: 74151 Message-Id: To: qemu-devel@nongnu.org Cc: amateur Date: Fri, 3 Dec 2010 15:36:29 +0200 From: amateur 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 files changed, 3 insertions(+), 1 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 035dfbd..abf21f6 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;