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



details:   https://anonhg.NetBSD.org/src/rev/9aafd8103d6d
branches:  netbsd-3
changeset: 576158:9aafd8103d6d
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Jun 10 15:24:46 2005 +0000

description:
Pull up revision 1.18 (requested by elad in ticket #389):
Use PAGE_SIZE chunks, not VERIEXEC_BUFSIZE - it's very important that the
size is not arbitrary and is exactly the size of a page.

diffstat:

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

diffs (49 lines):

diff -r 68a2ef5338b2 -r 9aafd8103d6d sys/kern/kern_verifiedexec.c
--- a/sys/kern/kern_verifiedexec.c      Fri Jun 10 15:24:18 2005 +0000
+++ b/sys/kern/kern_verifiedexec.c      Fri Jun 10 15:24:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.8 2005/06/10 15:24:18 tron Exp $   */
+/*     $NetBSD: kern_verifiedexec.c,v 1.9.2.9 2005/06/10 15:24:46 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.8 2005/06/10 15:24:18 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_verifiedexec.c,v 1.9.2.9 2005/06/10 15:24:46 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/mount.h>
@@ -65,8 +65,6 @@
 /* Veriexecs table of hash types and their associated information. */
 LIST_HEAD(veriexec_ops_head, veriexec_fp_ops) veriexec_ops_list;
 
-#define        VERIEXEC_BUFSIZE        PAGE_SIZE
-
 /*
  * Add fingerprint names to the global list.
  */
@@ -221,7 +219,7 @@
 
 
        ctx = (void *) malloc(vhe->ops->context_size, M_TEMP, M_WAITOK);
-       buf = (u_char *) malloc(VERIEXEC_BUFSIZE, M_TEMP, M_WAITOK);
+       buf = (u_char *) malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
 
        (vhe->ops->init)(ctx); /* init the fingerprint context */
 
@@ -229,9 +227,9 @@
         * The vnode is locked. sys_execve() does it for us; We have our
         * own locking in vn_open().
         */
-       for (offset = 0; offset < size; offset += VERIEXEC_BUFSIZE) {
-               len = ((size - offset) < VERIEXEC_BUFSIZE) ? (size - offset)
-                       : VERIEXEC_BUFSIZE;
+       for (offset = 0; offset < size; offset += PAGE_SIZE) {
+               len = ((size - offset) < PAGE_SIZE) ? (size - offset)
+                       : PAGE_SIZE;
 
                error = vn_rdwr(UIO_READ, vp, buf, len, offset, 
                                UIO_SYSSPACE,



Home | Main Index | Thread Index | Old Index