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-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d28b3c90cfad;p=qemu.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 --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b78eb686d8..02d3b6c90a 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); }