From d28b3c90cfad1a7e211ae2bce36ecb9071086129 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 6 Jul 2023 13:34:19 +0200 Subject: [PATCH] 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 --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }