diff options
author | Bryan Cantrill <bryan@joyent.com> | 2012-06-04 06:54:42 +0000 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2014-02-25 12:53:02 -0500 |
commit | b0f673c4626e4cb1db7785287eaeed2731dfefe8 (patch) | |
tree | d75fad195a057999974278cf1742080d6eebf350 /usr/src/uts/common/os/fio.c | |
parent | 3c7284bd3243d42a710edac3a15f6019b4c849be (diff) | |
download | illumos-joyent-b0f673c4626e4cb1db7785287eaeed2731dfefe8.tar.gz |
2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src/uts/common/os/fio.c')
-rw-r--r-- | usr/src/uts/common/os/fio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/fio.c b/usr/src/uts/common/os/fio.c index a014d25c0f..3b47e05ef2 100644 --- a/usr/src/uts/common/os/fio.c +++ b/usr/src/uts/common/os/fio.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, Joyent Inc. All rights reserved. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -54,6 +55,7 @@ #include <sys/poll.h> #include <sys/rctl.h> #include <sys/port_impl.h> +#include <sys/dtrace.h> #include <c2/audit.h> #include <sys/nbmlock.h> @@ -952,6 +954,18 @@ closef(file_t *fp) ASSERT(fp->f_count == 0); mutex_exit(&fp->f_tlock); + /* + * If DTrace has getf() subroutines active, it will set dtrace_closef + * to point to code that implements a barrier with respect to probe + * context. This must be called before the file_t is freed (and the + * vnode that it refers to is released) -- but it must be after the + * file_t has been removed from the uf_entry_t. That is, there must + * be no way for a racing getf() in probe context to yield the fp that + * we're operating upon. + */ + if (dtrace_closef != NULL) + (*dtrace_closef)(); + VN_RELE(vp); /* * deallocate resources to audit_data |