diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-07-28 21:52:24 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-07-28 21:52:24 +0000 |
commit | fac30ba8b4fd00a95fd7fb49c4e4dc1bcdf4003c (patch) | |
tree | 988681253e24923a9605bb54cb8a7c6531f1e9f9 /sys/kern | |
parent | 21e3bcee4378f043e902dc1bab9ac2915235f40a (diff) | |
download | FreeBSD-src-fac30ba8b4fd00a95fd7fb49c4e4dc1bcdf4003c.zip FreeBSD-src-fac30ba8b4fd00a95fd7fb49c4e4dc1bcdf4003c.tar.gz |
Rework vnode argument auditing to follow the same structure, in order
to avoid exposing ARG_ macros/flag values outside of the audit code in
order to name which one of two possible vnodes will be audited for a
system call.
Approved by: re (kib)
Obtained from: TrustedBSD Project
MFC after: 1 month
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_exec.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 16 |
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3f36658..663ab64 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -419,7 +419,7 @@ interpret: goto exec_fail; vfslocked = VFS_LOCK_GIANT(binvp->v_mount); vn_lock(binvp, LK_EXCLUSIVE | LK_RETRY); - AUDIT_ARG_VNODE(binvp, ARG_VNODE1); + AUDIT_ARG_VNODE1(binvp); imgp->vp = binvp; } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 2f3b54e..9fa6c9e 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -574,9 +574,9 @@ dirloop: ndp->ni_vp = dp; if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_VNODE(dp, ARG_VNODE1); + AUDIT_ARG_VNODE1(dp); else if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_VNODE(dp, ARG_VNODE2); + AUDIT_ARG_VNODE2(dp); if (!(cnp->cn_flags & (LOCKPARENT | LOCKLEAF))) VOP_UNLOCK(dp, 0); @@ -859,9 +859,9 @@ nextname: VOP_UNLOCK(ndp->ni_dvp, 0); if (cnp->cn_flags & AUDITVNODE1) - AUDIT_ARG_VNODE(dp, ARG_VNODE1); + AUDIT_ARG_VNODE1(dp); else if (cnp->cn_flags & AUDITVNODE2) - AUDIT_ARG_VNODE(dp, ARG_VNODE2); + AUDIT_ARG_VNODE2(dp); if ((cnp->cn_flags & LOCKLEAF) == 0) VOP_UNLOCK(dp, 0); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 28d95e2e..d24926b 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -379,7 +379,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); #ifdef AUDIT - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); #endif mp = vp->v_mount; if (mp) @@ -752,7 +752,7 @@ fchdir(td, uap) fdrop(fp, td); vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); error = change_dir(vp, td); while (!error && (mp = vp->v_mountedhere) != NULL) { int tvfslocked; @@ -2779,7 +2779,7 @@ fchflags(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfflags(td, fp->f_vnode, uap->flags); @@ -2940,7 +2940,7 @@ fchmod(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfmode(td, fp->f_vnode, uap->mode); @@ -3117,7 +3117,7 @@ fchown(td, uap) vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setfown(td, fp->f_vnode, uap->uid, uap->gid); @@ -3353,7 +3353,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); #ifdef AUDIT vn_lock(fp->f_vnode, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(fp->f_vnode, ARG_VNODE1); + AUDIT_ARG_VNODE1(fp->f_vnode); VOP_UNLOCK(fp->f_vnode, 0); #endif error = setutimes(td, fp->f_vnode, ts, 2, tptr == NULL); @@ -3513,7 +3513,7 @@ fsync(td, uap) lock_flags = LK_EXCLUSIVE; } vn_lock(vp, lock_flags | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); if (vp->v_object != NULL) { VM_OBJECT_LOCK(vp->v_object); vm_object_page_clean(vp->v_object, 0, 0, 0); @@ -4103,7 +4103,7 @@ unionread: auio.uio_td = td; auio.uio_resid = count; vn_lock(vp, LK_SHARED | LK_RETRY); - AUDIT_ARG_VNODE(vp, ARG_VNODE1); + AUDIT_ARG_VNODE1(vp); loff = auio.uio_offset = fp->f_offset; #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); |