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.12 (requested by elad in tick...



details:   https://anonhg.NetBSD.org/src/rev/6e38f330d72c
branches:  netbsd-3
changeset: 576119:6e38f330d72c
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Jun 10 15:00:14 2005 +0000

description:
Pull up revision 1.12 (requested by elad in ticket #389):
Fix possible bad memory reference, add panic on inconsistent state.

diffstat:

 sys/kern/kern_verifiedexec.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 293adc2a1dce -r 6e38f330d72c sys/kern/kern_verifiedexec.c
--- a/sys/kern/kern_verifiedexec.c      Fri Jun 10 14:59:55 2005 +0000
+++ b/sys/kern/kern_verifiedexec.c      Fri Jun 10 15:00:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.2 2005/06/10 14:59:55 tron Exp $   */
+/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.3 2005/06/10 15:00:14 tron Exp $   */
 
 /*-
  * Copyright 2005 Elad Efrat <elad%bsd.org.il@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.9.2.2 2005/06/10 14:59:55 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.9.2.3 2005/06/10 15:00:14 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -475,6 +475,8 @@
        if (error)
                return (error);
 
+       vhe = veriexec_lookup(va.va_fsid, va.va_fileid);
+       
        switch (vp->fp_status) {
        case FINGERPRINT_VALID:
        case FINGERPRINT_INDIRECT:
@@ -495,6 +497,11 @@
                                       va.va_fsid, va.va_fileid);
                        }
 
+                       if (vhe == NULL) {
+                               panic("Veriexec: tables inconsistent, vnode "
+                                     "has status but no fp entry found");
+                       }
+                       
                        goto veriexec_rm;
                }
 
@@ -509,7 +516,6 @@
                 * Could be we don't have an entry for this, but we can't
                 * risk an unevaluated file or vnode cache flush.
                 */
-               vhe = veriexec_lookup(va.va_fsid, va.va_fileid);
                if (vhe == NULL) {
                        break;
                }



Home | Main Index | Thread Index | Old Index