Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev Pull up revision 1.16 (requested by elad in ticke...



details:   https://anonhg.NetBSD.org/src/rev/08103ac3fbef
branches:  netbsd-3
changeset: 576380:08103ac3fbef
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 02 15:53:46 2005 +0000

description:
Pull up revision 1.16 (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/dev/verified_exec.c |  25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diffs (61 lines):

diff -r 27d8643a1551 -r 08103ac3fbef sys/dev/verified_exec.c
--- a/sys/dev/verified_exec.c   Sat Jul 02 15:53:40 2005 +0000
+++ b/sys/dev/verified_exec.c   Sat Jul 02 15:53:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: verified_exec.c,v 1.5.2.9 2005/07/02 15:51:20 tron Exp $       */
+/*     $NetBSD: verified_exec.c,v 1.5.2.10 2005/07/02 15:53:46 tron Exp $      */
 
 /*-
  * Copyright 2005 Elad Efrat <elad%bsd.org.il@localhost>
@@ -31,9 +31,9 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.5.2.9 2005/07/02 15:51:20 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.5.2.10 2005/07/02 15:53:46 tron Exp $");
 #else
-__RCSID("$Id: verified_exec.c,v 1.5.2.9 2005/07/02 15:51:20 tron Exp $\n$NetBSD: verified_exec.c,v 1.5.2.9 2005/07/02 15:51:20 tron Exp $");
+__RCSID("$Id: verified_exec.c,v 1.5.2.10 2005/07/02 15:53:46 tron Exp $\n$NetBSD: verified_exec.c,v 1.5.2.10 2005/07/02 15:53:46 tron Exp $");
 #endif
 
 #include <sys/param.h>
@@ -215,8 +215,6 @@
                        return (EINVAL);
                }
 
-               nid.ni_vp->fp_status = FINGERPRINT_NOTEVAL;
-
                /* Get attributes for device and inode. */
                error = VOP_GETATTR(nid.ni_vp, &va, p->p_ucred, p);
                if (error)
@@ -267,6 +265,7 @@
                e = malloc(sizeof(*e), M_TEMP, M_WAITOK);
                e->inode = va.va_fileid;
                e->type = params->type;
+               e->status = FINGERPRINT_NOTEVAL;
                if ((e->ops = veriexec_find_ops(params->fp_type)) == NULL) {
                        free(e, M_TEMP);
                        printf("Veriexec: veriexecioctl: Invalid or unknown "
@@ -276,14 +275,14 @@
                        return(EINVAL);
                }
 
-                 /*
-                  * Just a bit of a sanity check - require the size of
-                  * the fp to be passed in, check this against the expected
-                  * size.  Of course userland could lie deliberately, this
-                  * really only protects against the obvious fumble of
-                  * changing the fp type but not updating the fingerprint
-                  * string.
-                  */
+               /*
+                * Just a bit of a sanity check - require the size of
+                * the fp to be passed in, check this against the expected
+                * size.  Of course userland could lie deliberately, this
+                * really only protects against the obvious fumble of
+                * changing the fp type but not updating the fingerprint
+                * string.
+                */
                if (e->ops->hash_len != params->size) {
                        printf("Veriexec: veriexecioctl: Inconsistent "
                               "fingerprint size for type \"%s\" for file "



Home | Main Index | Thread Index | Old Index