Skip to contentSkip to conversation

linux-user: mmap_reserve() not controlled by RESERVED_VA

PATCH New amateur 1 participant 1 message Sep 14, 2010

lore
Share & tools
lore

amateur

author
#0 lore raw

PATCH 1/1 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.

linux-user/mmap.c +3 -1
index e10a6ef..50748a2 100644
@@ -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;
Signature · 1 line
If you don't drink it, someone else will.