Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jul 2016 16:37:02 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302345 - head/sys/kern
Message-ID:  <201607051637.u65Gb2UD049610@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607051637.u65Gb2UD049610>