aboutsummaryrefslogtreecommitdiff
path: root/libdecnumber/dpd/decimal32.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-07-17 08:37:17 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-07-31 08:52:38 +0300
commit0102c92a1c2736fc183bd464c1f899c96ca8faea (patch)
tree5f7008ace971622c0455f17093711126ef7baa8e /libdecnumber/dpd/decimal32.c
parent5de88d6e1021a8d6de0b70636126c68af0f7232d (diff)
linux-user: Fix qemu brk() to not zero bytes on current page
The qemu brk() implementation is too aggressive and cleans remaining bytes on the current page above the last brk address. But some existing applications are buggy and read/write bytes above their current heap address. On a phyiscal machine this does not trigger a runtime error as long as the access happens on the same page. Additionally the Linux kernel allocates only full pages and does no zeroing on already allocated pages, even if the brk address is lowered. Fix qemu to behave the same way as the kernel does. Do not touch already allocated pages, and - when running with different page sizes of guest and host - zero out only those memory areas where the host page size is bigger than the guest page size. Signed-off-by: Helge Deller <deller@gmx.de> Tested-by: "Markus F.X.J. Oberhumer" <markus@oberhumer.com> Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Cc: qemu-stable@nongnu.org Buglink: https://github.com/upx/upx/issues/683 (cherry picked from commit 15ad98536ad9410fb32ddf1ff09389b677643faa) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'libdecnumber/dpd/decimal32.c')
0 files changed, 0 insertions, 0 deletions