aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/cloudabi64/cloudabi64_module.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-11-18 20:07:43 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2019-11-18 20:07:43 +0000
commit03b0d68c7237a1610185bf8adbcdcc51cc1c3823 (patch)
tree2fcea92c35e69703d2128f14eb0513c93916f66d /sys/compat/cloudabi64/cloudabi64_module.c
parent85e06c728c68131e155a5e7138bec7f300d82433 (diff)
downloadsrc-03b0d68c7237a1610185bf8adbcdcc51cc1c3823.tar.gz
src-03b0d68c7237a1610185bf8adbcdcc51cc1c3823.zip
Check for errors from copyout() and suword*() in sv_copyout_args/strings.
Reviewed by: brooks, kib Tested on: amd64 (amd64, i386, linux64), i386 (i386, linux) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D22401
Notes
Notes: svn path=/head/; revision=354827
Diffstat (limited to 'sys/compat/cloudabi64/cloudabi64_module.c')
-rw-r--r--sys/compat/cloudabi64/cloudabi64_module.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/cloudabi64/cloudabi64_module.c b/sys/compat/cloudabi64/cloudabi64_module.c
index fd0be086aac3..7459b026d8ec 100644
--- a/sys/compat/cloudabi64/cloudabi64_module.c
+++ b/sys/compat/cloudabi64/cloudabi64_module.c
@@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$");
extern char _binary_cloudabi64_vdso_o_start[];
extern char _binary_cloudabi64_vdso_o_end[];
-register_t *
-cloudabi64_copyout_strings(struct image_params *imgp)
+int
+cloudabi64_copyout_strings(struct image_params *imgp, register_t **stack_base)
{
struct image_args *args;
uintptr_t begin;
@@ -56,8 +56,8 @@ cloudabi64_copyout_strings(struct image_params *imgp)
args = imgp->args;
len = exec_args_get_begin_envv(args) - args->begin_argv;
begin = rounddown2(imgp->sysent->sv_usrstack - len, sizeof(register_t));
- copyout(args->begin_argv, (void *)begin, len);
- return ((register_t *)begin);
+ *stack_base = (register_t *)begin;
+ return (copyout(args->begin_argv, (void *)begin, len));
}
int