Skip to content

Commit 1b41e31

Browse files
committed
Merge branch 'marler8997-mremapUnderflow2'
2 parents 5b9eb3a + d77cf81 commit 1b41e31

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

command/base

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ QEMU_SRC_URL="https://download.qemu.org/${QEMU_SRC_BASENAME}.tar.xz"
1313
QEMU_SRC_PREFIX="${QEMU_REV}"
1414

1515
# blank when QEMU_REV bumps, otherwise begin count from 1
16-
QEMU_REV_ZIG_SERIAL=1
16+
QEMU_REV_ZIG_SERIAL=2
1717
QEMU_REV_ZIG=${QEMU_REV_ZIG_SERIAL:+-z$QEMU_REV_ZIG_SERIAL}
1818
QEMU_ARTIFACT_BASENAME="${QEMU_NAME}-${HOST_OS}-${HOST_ARCH}-${QEMU_REV}${QEMU_REV_ZIG}"
1919

patch/mremap-underflow.diff

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ diff --git a/linux-user/mmap.c b/linux-user/mmap.c
22
index e378033797..da0fe4cc86 100644
33
--- a/linux-user/mmap.c
44
+++ b/linux-user/mmap.c
5-
@@ -708,7 +708,8 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
5+
@@ -708,7 +708,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
66
if (prot == 0) {
77
host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
88
if (host_addr != MAP_FAILED && reserved_va && old_size > new_size) {
99
- mmap_reserve(old_addr + old_size, new_size - old_size);
10-
+ if (new_size > old_size)
11-
+ mmap_reserve(old_addr + old_size, new_size - old_size);
10+
+ mmap_reserve(old_addr + old_size, old_size - new_size);
1211
}
1312
} else {
1413
errno = ENOMEM;

0 commit comments

Comments
 (0)