SHA256
1
0
forked from pool/qemu
qemu/0048-linux-user-guard-mmap_next_start-from-specific-maps.patch
Alexander Graf 44bce8debe - update update_git.sh for 1.0.1
- add fixes for reserved_va mmap(NULL) case, fixes git build on arm

OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=59
2012-03-03 23:28:15 +00:00

33 lines
984 B
Diff

From 48bc21facc19b458cef7e6936da6a012150f0bec Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Sun, 4 Mar 2012 00:18:05 +0100
Subject: [PATCH] linux-user: guard mmap_next_start from specific maps
If the guest process tells us to map at a specific address, we shouldn't
increase the "last automatic mapping ended here" variable.
This patch brings the reserved_va code in line with the default case.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
linux-user/mmap.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 2245f40..a0c1347 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -253,7 +253,11 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
}
}
}
- mmap_next_start = addr;
+
+ if (start == mmap_next_start && addr >= TASK_UNMAPPED_BASE) {
+ mmap_next_start = addr;
+ }
+
return last_addr;
}
#endif