aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/cloudabi64
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-07-08 20:09:21 +0000
committerEd Schouten <ed@FreeBSD.org>2016-07-08 20:09:21 +0000
commitd96aeddf2fb2e5f871a67a811ce0210936184d76 (patch)
treef673e01de4bd133d7c84ab3932131a5adb304598 /sys/amd64/cloudabi64
parent155a72b58a8c6233cc4db7b70fb7c60dd3c64667 (diff)
downloadsrc-d96aeddf2fb2e5f871a67a811ce0210936184d76.tar.gz
src-d96aeddf2fb2e5f871a67a811ce0210936184d76.zip
Don't forget to set sa->narg for CloudABI system calls.
It turns out that this value is not used within the system call code under normal conditions, except when using tracing tools like ktrace. If we forget to set this value, it is set to random garbage. This may cause ktrace to hang indefinitely, making it impossible to kill. Reported by: Michael Plass PR: 210800 MFC before: 11.0-RELEASE
Notes
Notes: svn path=/head/; revision=302448
Diffstat (limited to 'sys/amd64/cloudabi64')
-rw-r--r--sys/amd64/cloudabi64/cloudabi64_sysvec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
index f0aeb2e7b63a..08d85a2d5cb7 100644
--- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c
+++ b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
@@ -96,6 +96,7 @@ cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa)
if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL)
return (ENOSYS);
sa->callp = &cloudabi64_sysent[sa->code];
+ sa->narg = sa->callp->sy_narg;
/* Fetch system call arguments. */
sa->args[0] = frame->tf_rdi;