mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
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
This commit is contained in:
parent
e56b7f20a0
commit
a7f18116c2
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue