summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2016-07-12 06:25:28 +0000
committered <ed@FreeBSD.org>2016-07-12 06:25:28 +0000
commit33166d71434e04e189d98ff9b4cf81085e3e15b9 (patch)
tree2e2d20ab169cd103540fef791699e6d6d7b97f1d /sys/amd64
parentc610950f94c0899729905c29cd7345a7f980aee7 (diff)
downloadFreeBSD-src-33166d71434e04e189d98ff9b4cf81085e3e15b9.zip
FreeBSD-src-33166d71434e04e189d98ff9b4cf81085e3e15b9.tar.gz
MFC r302448:
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. Approved by: re@ Reported by: Michael Plass PR: 210800
Diffstat (limited to 'sys/amd64')
-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 f0aeb2e..08d85a2 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;
OpenPOWER on IntegriCloud