Message ID | 20230717213545.142598-2-deller@gmx.de |
---|---|
State | New |
Headers | show |
Series | linux-user: brk() syscall fixes and armhf static binary fix | expand |
On Jul 17 2023, Helge Deller wrote: > This reverts commit d28b3c90cfad1a7e211ae2bce36ecb9071086129. > > It just hides the real bug, and even the Linux kernel may > return page-unaligned addresses. The initial brk is always page aligned, see binfmt_elf.c:set_brk and the various arch_randomize_brk implementations.
On 7/18/23 15:53, Andreas Schwab wrote: > On Jul 17 2023, Helge Deller wrote: > >> This reverts commit d28b3c90cfad1a7e211ae2bce36ecb9071086129. >> >> It just hides the real bug, and even the Linux kernel may >> return page-unaligned addresses. > > The initial brk is always page aligned, see binfmt_elf.c:set_brk and the > various arch_randomize_brk implementations. Oh, your are absolutely right. I indeed missed to look at binfmt_elf.c:set_brk(). I'll drop this patch in the v2 series. Thanks! Helge
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index c99ef9c01e..b9527ab00f 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 = TARGET_PAGE_ALIGN(new_brk); + target_brk = new_brk; brk_page = HOST_PAGE_ALIGN(target_brk); }