From owner-svn-src-head@freebsd.org Thu Sep 22 23:22:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 011D3BE614B; Thu, 22 Sep 2016 23:22:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2DA9AFE; Thu, 22 Sep 2016 23:22:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8MNMr5O046368; Thu, 22 Sep 2016 23:22:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8MNMrxG046367; Thu, 22 Sep 2016 23:22:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201609222322.u8MNMrxG046367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Sep 2016 23:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306220 - head/sys/cddl/dev/systrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Sep 2016 23:22:55 -0000 Author: markj Date: Thu Sep 22 23:22:53 2016 New Revision: 306220 URL: https://svnweb.freebsd.org/changeset/base/306220 Log: Re-check the systrace probe ID before calling dtrace_probe(). Otherwise there exists a narrow window during which a syscall probe can be disabled and cause a concurrently-running thread to call dtrace_probe() with an invalid probe ID. Reported by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/cddl/dev/systrace/systrace.c Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Thu Sep 22 22:51:11 2016 (r306219) +++ head/sys/cddl/dev/systrace/systrace.c Thu Sep 22 23:22:53 2016 (r306220) @@ -193,7 +193,8 @@ systrace_probe(struct syscall_args *sa, memset(uargs, 0, sizeof(uargs)); if (type == SYSTRACE_ENTRY) { - id = sa->callp->sy_entry; + if ((id = sa->callp->sy_entry) == DTRACE_IDNONE) + return; if (sa->callp->sy_systrace_args_func != NULL) /* @@ -215,7 +216,8 @@ systrace_probe(struct syscall_args *sa, */ curthread->t_dtrace_systrace_args = uargs; } else { - id = sa->callp->sy_return; + if ((id = sa->callp->sy_return) == DTRACE_IDNONE) + return; curthread->t_dtrace_systrace_args = NULL; /* Set arg0 and arg1 as the return value of this syscall. */