svn commit: r302448 - in head/sys: amd64/cloudabi64 arm64/cloudabi64

Ed Schouten ed at FreeBSD.org
Fri Jul 8 20:09:23 UTC 2016


Author: ed
Date: Fri Jul  8 20:09:21 2016
New Revision: 302448
URL: https://svnweb.freebsd.org/changeset/base/302448

Log:
  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

Modified:
  head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  head/sys/arm64/cloudabi64/cloudabi64_sysvec.c

Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Fri Jul  8 19:19:30 2016	(r302447)
+++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Fri Jul  8 20:09:21 2016	(r302448)
@@ -96,6 +96,7 @@ cloudabi64_fetch_syscall_args(struct thr
 	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;

Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Fri Jul  8 19:19:30 2016	(r302447)
+++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Fri Jul  8 20:09:21 2016	(r302448)
@@ -77,6 +77,7 @@ cloudabi64_fetch_syscall_args(struct thr
 	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++)


More information about the svn-src-all mailing list