mirror of https://github.com/xqemu/xqemu.git
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>
This commit is contained in:
parent
b0e102dd22
commit
c65ffe6d6c
|
@ -697,8 +697,10 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
|
||||||
old_size, new_size,
|
old_size, new_size,
|
||||||
flags | MREMAP_FIXED,
|
flags | MREMAP_FIXED,
|
||||||
g2h(mmap_start));
|
g2h(mmap_start));
|
||||||
|
if ( RESERVED_VA ) {
|
||||||
mmap_reserve(old_addr, old_size);
|
mmap_reserve(old_addr, old_size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
int prot = 0;
|
int prot = 0;
|
||||||
if (RESERVED_VA && old_size < new_size) {
|
if (RESERVED_VA && old_size < new_size) {
|
||||||
|
|
Loading…
Reference in New Issue