Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jul 2005 15:22:53 GMT
From:      Wayne Salamon <wsalamon@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 80398 for review
Message-ID:  <200507171522.j6HFMr7P023280@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=80398

Change 80398 by wsalamon@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);



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