Date: Tue, 12 Jul 2016 06:25:28 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r302627 - in stable/11/sys: amd64/cloudabi64 arm64/cloudabi64 Message-ID: <201607120625.u6C6PSrx083399@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Tue Jul 12 06:25:28 2016 New Revision: 302627 URL: https://svnweb.freebsd.org/changeset/base/302627 Log: 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 Modified: stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jul 12 06:12:58 2016 (r302626) +++ stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jul 12 06:25:28 2016 (r302627) @@ -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: stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c Tue Jul 12 06:12:58 2016 (r302626) +++ stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c Tue Jul 12 06:25:28 2016 (r302627) @@ -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++)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607120625.u6C6PSrx083399>