From owner-p4-projects@FreeBSD.ORG Sun Jul 17 15:22:54 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6EBAD16A420; Sun, 17 Jul 2005 15:22:54 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 475AA16A41C for ; Sun, 17 Jul 2005 15:22:54 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1910643D46 for ; Sun, 17 Jul 2005 15:22:54 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6HFMrEs023283 for ; Sun, 17 Jul 2005 15:22:54 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6HFMr7P023280 for perforce@freebsd.org; Sun, 17 Jul 2005 15:22:53 GMT (envelope-from wsalamon@computer.org) Date: Sun, 17 Jul 2005 15:22:53 GMT Message-Id: <200507171522.j6HFMr7P023280@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 80398 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2005 15:22:55 -0000 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);