From: Andreas Schwab Date: Thu, 6 Jul 2023 11:34:19 +0000 (+0200) Subject: linux-user: Make sure initial brk(0) is page-aligned X-Git-Tag: qemu-xen-4.18.0-rc5~55 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0167759c9a9ffe89b1479cd95486fdc687ceb677;p=qemu-xen.git linux-user: Make sure initial brk(0) is page-aligned Fixes: 86f04735ac ("linux-user: Fix brk() to release pages") Signed-off-by: Andreas Schwab Message-Id: Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson (cherry picked from commit d28b3c90cfad1a7e211ae2bce36ecb9071086129) Signed-off-by: Michael Tokarev --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 71559f81d4..cb5d72867a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -806,7 +806,7 @@ static abi_ulong brk_page; void target_set_brk(abi_ulong new_brk) { - target_brk = new_brk; + target_brk = TARGET_PAGE_ALIGN(new_brk); brk_page = HOST_PAGE_ALIGN(target_brk); }