summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu/mmap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/mmap.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu/mmap.patch29
1 files changed, 0 insertions, 29 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/mmap.patch b/meta/recipes-devtools/qemu/qemu/mmap.patch
deleted file mode 100644
index edd9734f30..0000000000
--- a/meta/recipes-devtools/qemu/qemu/mmap.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1If mremap() is called without the MREMAP_MAYMOVE flag with a start address
2just before the end of memory (reserved_va) where new_size would exceed
3GUEST_ADD_MAX, the assert(end - 1 <= GUEST_ADDR_MAX) in page_set_flags()
4would trigger.
5
6Add an extra guard to the guest_range_valid() checks to prevent this and
7avoid asserting binaries when reserved_va is set.
8
9This meant a test case now gives the same behaviour regardless of whether
10reserved_va is set or not.
11
12Upstream-Status: Backport [https://github.com/qemu/qemu/commit/ccc5ccc17f8cfbfd87d9aede5d12a2d47c56e712]
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
14
15Index: qemu-5.2.0/linux-user/mmap.c
16===================================================================
17--- qemu-5.2.0.orig/linux-user/mmap.c
18+++ qemu-5.2.0/linux-user/mmap.c
19@@ -727,7 +727,9 @@ abi_long target_mremap(abi_ulong old_add
20
21 if (!guest_range_valid(old_addr, old_size) ||
22 ((flags & MREMAP_FIXED) &&
23- !guest_range_valid(new_addr, new_size))) {
24+ !guest_range_valid(new_addr, new_size)) ||
25+ ((flags & MREMAP_MAYMOVE) == 0 &&
26+ !guest_range_valid(old_addr, new_size))) {
27 errno = ENOMEM;
28 return -1;
29 }