PERFORCE change 84046 for review
Robert Watson
rwatson at FreeBSD.org
Wed Sep 21 11:04:16 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=84046
Change 84046 by rwatson at rwatson_zoo on 2005/09/21 11:03:31
In audit_sysclose(), optionally lock and unlock Giant, and always
lock and unlock the vnode when auditing vnode information.
Affected files ...
.. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#33 edit
Differences ...
==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#33 (text+ko) ====
@@ -2452,14 +2452,21 @@
void
audit_sysclose(struct thread *td, int fd)
{
+ struct vnode *vp;
struct file *fp;
+ int vfslocked;
audit_arg_fd(fd);
if (getvnode(td->td_proc->p_fd, fd, &fp) != 0)
return;
- audit_arg_vnpath((struct vnode *)fp->f_vnode, ARG_VNODE1);
+ vp = fp->f_vnode;
+ vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
+ audit_arg_vnpath(vp, ARG_VNODE1);
+ VOP_UNLOCK(vp, 0, td);
+ VFS_UNLOCK_GIANT(vfslocked);
fdrop(fp, td);
}
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list