mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-19 15:33:56 +00:00
Use shared vnode locks for auditing vnode arguments as auditing only
does a VOP_GETATTR() which does not require an exclusive lock. Reviewed by: csjp, rwatson
This commit is contained in:
parent
16da60664d
commit
927edcc9ba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184661
@ -2734,7 +2734,7 @@ fchflags(td, uap)
|
||||
return (error);
|
||||
vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
|
||||
#ifdef AUDIT
|
||||
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY);
|
||||
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
|
||||
VOP_UNLOCK(fp->f_vnode, 0);
|
||||
#endif
|
||||
@ -2896,7 +2896,7 @@ fchmod(td, uap)
|
||||
return (error);
|
||||
vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
|
||||
#ifdef AUDIT
|
||||
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY);
|
||||
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
|
||||
VOP_UNLOCK(fp->f_vnode, 0);
|
||||
#endif
|
||||
@ -3074,7 +3074,7 @@ fchown(td, uap)
|
||||
return (error);
|
||||
vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
|
||||
#ifdef AUDIT
|
||||
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY);
|
||||
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
|
||||
VOP_UNLOCK(fp->f_vnode, 0);
|
||||
#endif
|
||||
@ -3311,7 +3311,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr,
|
||||
return (error);
|
||||
vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount);
|
||||
#ifdef AUDIT
|
||||
vn_lock(fp->f_vnode, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY);
|
||||
AUDIT_ARG(vnode, fp->f_vnode, ARG_VNODE1);
|
||||
VOP_UNLOCK(fp->f_vnode, 0);
|
||||
#endif
|
||||
|
@ -631,7 +631,7 @@ audit_arg_file(struct proc *p, struct file *fp)
|
||||
*/
|
||||
vp = fp->f_vnode;
|
||||
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||
audit_arg_vnode(vp, ARG_VNODE1);
|
||||
VOP_UNLOCK(vp, 0);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
@ -849,7 +849,7 @@ audit_sysclose(struct thread *td, int fd)
|
||||
|
||||
vp = fp->f_vnode;
|
||||
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||
audit_arg_vnode(vp, ARG_VNODE1);
|
||||
VOP_UNLOCK(vp, 0);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
|
Loading…
Reference in New Issue
Block a user