Fix EFAULT at startup. Signed-off-by: Maya Rashish <co...@sdf.org> --- bsd-user/netbsd/target_os_stack.h | 2 +- bsd-user/openbsd/target_os_stack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bsd-user/netbsd/target_os_stack.h b/bsd-user/netbsd/target_os_stack.h index 503279c1a9..f3cfbe8626 100644 --- a/bsd-user/netbsd/target_os_stack.h +++ b/bsd-user/netbsd/target_os_stack.h @@ -40,7 +40,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p, for (i = 0; i < MAX_ARG_PAGES; i++) { if (bprm->page[i]) { info->rss++; - if (!memcpy_to_target(stack_base, bprm->page[i], + if (memcpy_to_target(stack_base, bprm->page[i], TARGET_PAGE_SIZE)) { errno = EFAULT; return -1; diff --git a/bsd-user/openbsd/target_os_stack.h b/bsd-user/openbsd/target_os_stack.h index 4b37955d3b..3f799ef5d1 100644 --- a/bsd-user/openbsd/target_os_stack.h +++ b/bsd-user/openbsd/target_os_stack.h @@ -40,7 +40,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p, for (i = 0; i < MAX_ARG_PAGES; i++) { if (bprm->page[i]) { info->rss++; - if (!memcpy_to_target(stack_base, bprm->page[i], + if (memcpy_to_target(stack_base, bprm->page[i], TARGET_PAGE_SIZE)) { errno = EFAULT; return -1; -- 2.35.1