PERFORCE change 80398 for review

Wayne Salamon wsalamon at FreeBSD.org
Sun Jul 17 15:22:53 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=80398

Change 80398 by wsalamon at gretsch on 2005/07/17 15:22:39

	Audit the stat/ostat/nstat, fstat/ofstat/nfstat, and statfs system
	calls. In the fd-related system calls, we still attempt to audit the
	pathname. This attempt will probably go away in the future, for these
	and other calls.

Affected files ...

.. //depot/projects/trustedbsd/audit3/sys/kern/kern_descrip.c#6 edit
.. //depot/projects/trustedbsd/audit3/sys/kern/vfs_syscalls.c#9 edit

Differences ...

==== //depot/projects/trustedbsd/audit3/sys/kern/kern_descrip.c#6 (text+ko) ====

@@ -1085,8 +1085,14 @@
 	struct file *fp;
 	int error;
 
+	AUDIT_ARG(fd, fd);
+
 	if ((error = fget(td, fd, &fp)) != 0)
 		return (error);
+
+	//XXX Grab the vnode lock?
+	AUDIT_ARG(vnpath, fp->f_vnode, ARG_VNODE1);
+
 	error = fo_stat(fp, sbp, td->td_ucred, td);
 	fdrop(fp, td);
 	return (error);

==== //depot/projects/trustedbsd/audit3/sys/kern/vfs_syscalls.c#9 (text+ko) ====

@@ -250,7 +250,7 @@
 	struct nameidata nd;
 
 	mtx_lock(&Giant);
-	NDINIT(&nd, LOOKUP, FOLLOW, pathseg, path, td);
+	NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNPATH1, pathseg, path, td);
 	error = namei(&nd);
 	if (error) {
 		mtx_unlock(&Giant);
@@ -2078,7 +2078,8 @@
 	struct stat sb;
 	int error, vfslocked;
 
-	NDINIT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE,
+	NDINIT(&nd, LOOKUP,
+	    FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | AUDITVNPATH1,
 	    pathseg, path, td);
 	if ((error = namei(&nd)) != 0)
 		return (error);
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