[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/42] bsd-user: Fix calculation of size to allocate
From: |
imp |
Subject: |
[PULL 09/42] bsd-user: Fix calculation of size to allocate |
Date: |
Tue, 7 Sep 2021 15:52:59 -0600 |
From: Warner Losh <imp@bsdimp.com>
It was incorrect to subtract off the size of an unsigned int here. In
bsd-user fork, this change was made when moving the arch specific items
to specific files. The size in BSD that's available for the arguments
does not need a return address subtracted from it.
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/bsdload.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index 5282a7c4f2..379015c744 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -143,10 +143,9 @@ int loader_exec(const char *filename, char **argv, char
**envp,
struct target_pt_regs *regs, struct image_info *infop,
struct bsd_binprm *bprm)
{
- int retval;
- int i;
+ int retval, i;
- bprm->p = TARGET_PAGE_SIZE * MAX_ARG_PAGES - sizeof(unsigned int);
+ bprm->p = TARGET_PAGE_SIZE * MAX_ARG_PAGES;
for (i = 0; i < MAX_ARG_PAGES; i++) { /* clear page-table */
bprm->page[i] = NULL;
}
--
2.32.0
- [PULL 00/42] bsd-user updates to run hello world, imp, 2021/09/07
- [PULL 05/42] bsd-user: style nits: bsdload.c whitespace to qemu standard, imp, 2021/09/07
- [PULL 02/42] bsd-user: add copyright header to elfload.c, imp, 2021/09/07
- [PULL 04/42] bsd-user: add license to bsdload.c, imp, 2021/09/07
- [PULL 01/42] bsd-user: remove sparc and sparc64, imp, 2021/09/07
- [PULL 06/42] bsd-user: Remove all non-x86 code from elfload.c, imp, 2021/09/07
- [PULL 03/42] bsd-user: Add Stacey's copyright to main.c, imp, 2021/09/07
- [PULL 08/42] bsd-user: pass the bsd_param into loader_exec, imp, 2021/09/07
- [PULL 13/42] bsd-user: TARGET_NGROUPS unused in this file, remove, imp, 2021/09/07
- [PULL 07/42] bsd-user: move arch specific defines out of elfload.c, imp, 2021/09/07
- [PULL 09/42] bsd-user: Fix calculation of size to allocate,
imp <=
- [PULL 12/42] bsd-user: remove a.out support, imp, 2021/09/07
- [PULL 17/42] bsd-user: Include host-os.h from main, imp, 2021/09/07
- [PULL 22/42] bsd-user: Include more things in qemu.h, imp, 2021/09/07
- [PULL 10/42] bsd-user: implement path searching, imp, 2021/09/07
- [PULL 15/42] bsd-user: assume pthreads and support of __thread, imp, 2021/09/07
- [PULL 14/42] bsd-user: elfload: simplify bswap a bit., imp, 2021/09/07
- [PULL 16/42] bsd-user: add host-os.h, imp, 2021/09/07
- [PULL 18/42] bsd-user: save the path to the qemu emulator, imp, 2021/09/07
- [PULL 19/42] bsd-user: start to move target CPU functions to target_arch*, imp, 2021/09/07
- [PULL 29/42] bsd-user: Add architecture specific signal tramp code, imp, 2021/09/07