svn commit: r302345 - head/sys/kern
Robert Watson
rwatson at FreeBSD.org
Tue Jul 5 16:37:03 UTC 2016
Author: rwatson
Date: Tue Jul 5 16:37:01 2016
New Revision: 302345
URL: https://svnweb.freebsd.org/changeset/base/302345
Log:
Call audit hooks to capture vnode attributes for three file-descriptor
method implementations: fstat(2), close(2), and poll(2). This change
synchronises auditing here with similar auditing for VFS-specific system
calls such as stat(2) that audit more complete vnode information.
Sponsored by: DARPA, AFRL
Approved by: re (kib)
MFC after: 1 week
Modified:
head/sys/kern/vfs_vnops.c
Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c Tue Jul 5 14:46:06 2016 (r302344)
+++ head/sys/kern/vfs_vnops.c Tue Jul 5 16:37:01 2016 (r302345)
@@ -440,6 +440,7 @@ vn_close(vp, flags, file_cred, td)
vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, lock_flags | LK_RETRY);
+ AUDIT_ARG_VNODE1(vp);
if ((flags & (FWRITE | FOPENFAILED)) == FWRITE) {
VNASSERT(vp->v_writecount > 0, vp,
("vn_close: negative writecount"));
@@ -1362,6 +1363,7 @@ vn_stat(vp, sb, active_cred, file_cred,
int error;
u_short mode;
+ AUDIT_ARG_VNODE1(vp);
#ifdef MAC
error = mac_vnode_check_stat(active_cred, file_cred, vp);
if (error)
@@ -1511,6 +1513,7 @@ vn_poll(fp, events, active_cred, td)
vp = fp->f_vnode;
#ifdef MAC
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+ AUDIT_ARG_VNODE1(vp);
error = mac_vnode_check_poll(active_cred, fp->f_cred, vp);
VOP_UNLOCK(vp, 0);
if (!error)
More information about the svn-src-all
mailing list