Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/kern Pull up revision 1.92 (requested by elad in tick...



details:   https://anonhg.NetBSD.org/src/rev/03833ec00864
branches:  netbsd-3
changeset: 576378:03833ec00864
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 02 15:53:33 2005 +0000

description:
Pull up revision 1.92 (requested by elad in ticket #487):
- Avoid pollution of struct vnode. Save the fingerprint evaluation status
in the veriexec table entry; the lookups are very cheap now. Suggested
by Chuq.
- Handle non-regular (!VREG) files correctly).
- Remove (no longer needed) FINGERPRINT_NOENTRY.

diffstat:

 sys/kern/vfs_vnops.c |  22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diffs (64 lines):

diff -r 4ef773810348 -r 03833ec00864 sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c      Sat Jul 02 15:52:41 2005 +0000
+++ b/sys/kern/vfs_vnops.c      Sat Jul 02 15:53:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnops.c,v 1.86.2.3 2005/07/02 15:51:06 tron Exp $  */
+/*     $NetBSD: vfs_vnops.c,v 1.86.2.4 2005/07/02 15:53:33 tron Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.86.2.3 2005/07/02 15:51:06 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.86.2.4 2005/07/02 15:53:33 tron Exp $");
 
 #include "fs_union.h"
 
@@ -102,15 +102,9 @@
        struct ucred *cred = p->p_ucred;
        struct vattr va;
        int error;
-#ifdef NEVER /* for the moment I am not convinced this is needed since NDINIT should do this lookup...XXXX blymn */
-       char pathbuf[MAXPATHLEN];
-       unsigned pathlen;
-
-        if (ndp->ni_segflg == UIO_SYSSPACE)
-                error = copystr(pathbuf, ndp->ni_dirp, MAXPATHLEN, &pathlen);
-        else
-                error = copyinstr(pathbuf, ndp->ni_dirp,MAXPATHLEN, &pathlen);
-#endif
+#ifdef VERIFIED_EXEC
+       struct veriexec_hash_entry *vhe = NULL;
+#endif /* VERIFIED_EXEC */
 
 restart:
        if (fmode & O_CREAT) {
@@ -198,7 +192,7 @@
 #ifdef VERIFIED_EXEC
                /* XXX may need pathbuf instead */
                if ((error = veriexec_verify(p, vp, &va, ndp->ni_dirp,
-                                            VERIEXEC_FILE)) != 0)
+                                            VERIEXEC_FILE, &vhe)) != 0)
                        goto bad;
 #endif
 
@@ -216,7 +210,7 @@
                            (error = VOP_ACCESS(vp, VWRITE, cred, p)) != 0)
                                goto bad;
 #ifdef VERIFIED_EXEC
-                       if (vp->fp_status != FINGERPRINT_NOENTRY) {
+                       if (vhe != NULL) {
                                veriexec_report("Write access request.",
                                                ndp->ni_dirp, &va, p,
                                                REPORT_NOVERBOSE,
@@ -228,7 +222,7 @@
                                        error = EPERM;
                                        goto bad;
                                } else {
-                                       vp->fp_status = FINGERPRINT_NOTEVAL;
+                                       vhe->status = FINGERPRINT_NOTEVAL;
                                }
                        }
 #endif



Home | Main Index | Thread Index | Old Index