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.219 (requested by elad in tic...



details:   https://anonhg.NetBSD.org/src/rev/8ae58b7a7107
branches:  netbsd-3
changeset: 576102:8ae58b7a7107
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Jun 10 14:49:10 2005 +0000

description:
Pull up revision 1.219 (requested by elad in ticket #389):
Rototill of the verified exec functionality.
* We now use hash tables instead of a list to store the in kernel
fingerprints.
* Fingerprint methods handling has been made more flexible, it is now
even simpler to add new methods.
* the loader no longer passes in magic numbers representing the
fingerprint method so veriexecctl is not longer kernel specific.
* fingerprint methods can be tailored out using options in the kernel
config file.
* more fingerprint methods added - rmd160, sha256/384/512
* veriexecctl can now report the fingerprint methods supported by the
running kernel.
* regularised the naming of some portions of veriexec.

diffstat:

 sys/kern/vfs_syscalls.c |  23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (51 lines):

diff -r 03451fb0cb23 -r 8ae58b7a7107 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Fri Jun 10 14:49:03 2005 +0000
+++ b/sys/kern/vfs_syscalls.c   Fri Jun 10 14:49:10 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.217.2.1 2005/04/13 21:31:09 tron Exp $      */
+/*     $NetBSD: vfs_syscalls.c,v 1.217.2.2 2005/06/10 14:49:10 tron Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.217.2.1 2005/04/13 21:31:09 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.217.2.2 2005/06/10 14:49:10 tron Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_43.h"
@@ -64,6 +64,9 @@
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif
+#ifdef VERIFIED_EXEC
+#include <sys/verified_exec.h>
+#endif
 
 #include <miscfs/genfs/genfs.h>
 #include <miscfs/syncfs/syncfs.h>
@@ -1827,6 +1830,22 @@
                error = EBUSY;
                goto out;
        }
+
+         /*
+          * Remove the fingerprint from the list if there was one.
+          */
+#ifdef VERIFIED_EXEC
+       if ((error = veriexec_removechk(p, vp, nd.ni_dirp)) != 0) {
+               VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
+               if (nd.ni_dvp == vp)
+                       vrele(nd.ni_dvp);
+               else
+                       vput(nd.ni_dvp);
+               vput(vp);
+               goto out;
+       }
+#endif
+       
        if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) {
                VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
                if (nd.ni_dvp == vp)



Home | Main Index | Thread Index | Old Index