[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for 6.2 11/49] bsd-user: Fix calculation of size to allocate
From: |
Warner Losh |
Subject: |
[PATCH for 6.2 11/49] bsd-user: Fix calculation of size to allocate |
Date: |
Sat, 7 Aug 2021 15:42:04 -0600 |
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>
---
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
- [PATCH for 6.2 07/49] bsd-user: style nits: apply qemu style to these files, (continued)
- [PATCH for 6.2 07/49] bsd-user: style nits: apply qemu style to these files, Warner Losh, 2021/08/07
- [PATCH for 6.2 06/49] bsd-user: merge comments and guards from bsd-user fork, Warner Losh, 2021/08/07
- [PATCH for 6.2 08/49] bsd-user: style nits: fix whitespace issues to be qemu standard, Warner Losh, 2021/08/07
- [PATCH for 6.2 09/49] bsd-user: add license, Warner Losh, 2021/08/07
- [PATCH for 6.2 10/49] bsd-user: pass the bsd_param into loader_exec, Warner Losh, 2021/08/07
- [PATCH for 6.2 11/49] bsd-user: Fix calculation of size to allocate,
Warner Losh <=
- [PATCH for 6.2 12/49] bsd-user: implement path searching, Warner Losh, 2021/08/07
- [PATCH for 6.2 13/49] bsd-user: Eliminate elf personality, Warner Losh, 2021/08/07
- [PATCH for 6.2 14/49] bsd-user: remove a.out support, Warner Losh, 2021/08/07
- [PATCH for 6.2 15/49] bsd-user: TARGET_NGROUPS unused in this file, remove, Warner Losh, 2021/08/07