aboutsummaryrefslogtreecommitdiff
path: root/event-loop-base.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-07-17 08:37:17 +0200
committerHelge Deller <deller@gmx.de>2023-07-18 20:42:05 +0200
commit15ad98536ad9410fb32ddf1ff09389b677643faa (patch)
treedfd92cd0eca288962b0997acc95e5d1d22f19e09 /event-loop-base.c
parent361d5397355276e3007825cc17217c1e4d4320f7 (diff)
downloadqemu-15ad98536ad9410fb32ddf1ff09389b677643faa.zip
qemu-15ad98536ad9410fb32ddf1ff09389b677643faa.tar.gz
qemu-15ad98536ad9410fb32ddf1ff09389b677643faa.tar.bz2
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
Diffstat (limited to 'event-loop-base.c')
0 files changed, 0 insertions, 0 deletions