diff options
author | Ed Schouten <ed@FreeBSD.org> | 2016-07-08 20:09:21 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2016-07-08 20:09:21 +0000 |
commit | d96aeddf2fb2e5f871a67a811ce0210936184d76 (patch) | |
tree | f673e01de4bd133d7c84ab3932131a5adb304598 /sys | |
parent | 155a72b58a8c6233cc4db7b70fb7c60dd3c64667 (diff) | |
download | src-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')
-rw-r--r-- | sys/amd64/cloudabi64/cloudabi64_sysvec.c | 1 | ||||
-rw-r--r-- | sys/arm64/cloudabi64/cloudabi64_sysvec.c | 1 |
2 files changed, 2 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; diff --git a/sys/arm64/cloudabi64/cloudabi64_sysvec.c b/sys/arm64/cloudabi64/cloudabi64_sysvec.c index 913d1278ffd3..cf3e594244bb 100644 --- a/sys/arm64/cloudabi64/cloudabi64_sysvec.c +++ b/sys/arm64/cloudabi64/cloudabi64_sysvec.c @@ -77,6 +77,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. */ for (i = 0; i < MAXARGS; i++) |