summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-09-09 10:52:36 +0000
committerkib <kib@FreeBSD.org>2009-09-09 10:52:36 +0000
commit7a991968f269912366e4d3bdc20512ba61249fc8 (patch)
tree0a61e8cece6bd50b657d7ea71c6cacf38f1fc243 /sys/kern/kern_exec.c
parent3119d26c952b144660c1507510826da62234c628 (diff)
downloadFreeBSD-src-7a991968f269912366e4d3bdc20512ba61249fc8.zip
FreeBSD-src-7a991968f269912366e4d3bdc20512ba61249fc8.tar.gz
Unlock the image vnode around the call of pmc PMC_FN_PROCESS_EXEC hook.
The hook calls vn_fullpath(9), that should not be executed with a vnode lock held. Reported by: Bruce Cran <bruce cran org uk> Tested by: pho MFC after: 3 days
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index e770d07..a90968f 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -786,10 +786,12 @@ interpret:
*/
if (PMC_SYSTEM_SAMPLING_ACTIVE() || PMC_PROC_IS_USING_PMCS(p)) {
PROC_UNLOCK(p);
+ VOP_UNLOCK(imgp->vp, 0);
pe.pm_credentialschanged = credential_changing;
pe.pm_entryaddr = imgp->entry_addr;
PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe);
+ vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
} else
PROC_UNLOCK(p);
#else /* !HWPMC_HOOKS */
OpenPOWER on IntegriCloud