aboutsummaryrefslogtreecommitdiff
path: root/cpus-common.c
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2020-05-02 10:12:25 -0600
committerLaurent Vivier <laurent@vivier.eu>2020-06-05 21:23:22 +0200
commit257a7e212d5e518ac53bd6a02a3157cf4594c8b3 (patch)
tree0ae92131a977d26170d8f2f1f3ab2ab856528c29 /cpus-common.c
parentfd568660b7ae9b9e45cbb616acc91ae4c065c32d (diff)
linux-user/mmap.c: fix integer underflow in target_mremap
Fixes: https://bugs.launchpad.net/bugs/1876373 This code path in mmap occurs when a page size is decreased with mremap. When a section of pages is shrunk, qemu calls mmap_reserve on the pages that were released. However, it has the diff operation reversed, subtracting the larger old_size from the smaller new_size. Instead, it should be subtracting the smaller new_size from the larger old_size. You can also see in the previous line of the change that this mmap_reserve call only occurs when old_size > new_size. Bug: https://bugs.launchpad.net/qemu/+bug/1876373 Signed-off-by: Jonathan Marler <johnnymarler@gmail.com> Reviewded-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200502161225.14346-1-johnnymarler@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'cpus-common.c')
0 files changed, 0 insertions, 0 deletions