summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-02-07 23:44:31 +0000
committerrwatson <rwatson@FreeBSD.org>2006-02-07 23:44:31 +0000
commit93a12ad07f47ea354b54df265d61a7536cfe3aa8 (patch)
tree43d58bb1736a0d3960bced9b346cb92d06346b40 /sys/security
parentf63c10401343a5ef8732d995509812bdfc1c8e34 (diff)
downloadFreeBSD-src-93a12ad07f47ea354b54df265d61a7536cfe3aa8.zip
FreeBSD-src-93a12ad07f47ea354b54df265d61a7536cfe3aa8.tar.gz
Acquire vnode lock around call to VOP_GETATTR() in audit_record_write().
In the future, we may want to acquire the lock early in the function and hold it across calls to vn_rdwr(), etc, to avoid multiple acquires. Spotted by: kris (bugmagnet) Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c
index 3ddad11..bc3a795 100644
--- a/sys/security/audit/audit.c
+++ b/sys/security/audit/audit.c
@@ -282,7 +282,9 @@ audit_record_write(struct vnode *vp, struct kaudit_record *ar,
if (ret)
goto out;
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
ret = VOP_GETATTR(vp, &vattr, cred, td);
+ VOP_UNLOCK(vp, 0, td);
if (ret)
goto out;
OpenPOWER on IntegriCloud