Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/27d8643a1551
branches:  netbsd-3
changeset: 576379:27d8643a1551
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 02 15:53:40 2005 +0000

description:
Pull up revision 1.13 (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/sys/verified_exec.h |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r 03833ec00864 -r 27d8643a1551 sys/sys/verified_exec.h
--- a/sys/sys/verified_exec.h   Sat Jul 02 15:53:33 2005 +0000
+++ b/sys/sys/verified_exec.h   Sat Jul 02 15:53:40 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: verified_exec.h,v 1.6.2.5 2005/06/10 15:25:08 tron Exp $       */
+/*     $NetBSD: verified_exec.h,v 1.6.2.6 2005/07/02 15:53:40 tron Exp $       */
 
 /*-
  * Copyright 2005 Elad Efrat <elad%bsd.org.il@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: verified_exec.h,v 1.6.2.5 2005/06/10 15:25:08 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: verified_exec.h,v 1.6.2.6 2005/07/02 15:53:40 tron Exp $");
 
 /*
  *
@@ -119,11 +119,17 @@
 struct veriexec_hash_entry {
         ino_t         inode;                        /* Inode number. */
         unsigned char type;                         /* Entry type. */
+       unsigned char status;                       /* Evaluation status. */
         unsigned char *fp;                          /* Fingerprint. */
        struct veriexec_fp_ops *ops;                /* Fingerprint ops vector*/
         LIST_ENTRY(veriexec_hash_entry) entries;    /* List pointer. */
 };
 
+/* Valid status field values. */
+#define FINGERPRINT_NOTEVAL  0  /* fingerprint has not been evaluated */
+#define FINGERPRINT_VALID    1  /* fingerprint evaluated and matches list */
+#define FINGERPRINT_NOMATCH  2  /* fingerprint evaluated but does not match */
+
 LIST_HEAD(veriexec_hashhead, veriexec_hash_entry) *hash_tbl;
 
 /* Veriexec hash table information. */
@@ -175,13 +181,11 @@
 int veriexec_fp_calc(struct proc *, struct vnode *,
                     struct veriexec_hash_entry *, uint64_t, u_char *);
 int veriexec_fp_cmp(struct veriexec_fp_ops *, u_char *, u_char *);
-
 struct veriexec_hashtbl *veriexec_tblfind(dev_t);
 struct veriexec_hash_entry *veriexec_lookup(dev_t, ino_t);
 int veriexec_hashadd(struct veriexec_hashtbl *, struct veriexec_hash_entry *);
-
 int veriexec_verify(struct proc *, struct vnode *, struct vattr *,
-                   const u_char *, int);
+                   const u_char *, int, struct veriexec_hash_entry **);
 int veriexec_removechk(struct proc *, struct vnode *, const char *);
 void veriexec_init_fp_ops(void);
 void veriexec_report(const u_char *, const u_char *, struct vattr *,



Home | Main Index | Thread Index | Old Index