Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode Explicitly protect the kernel ima...



details:   https://anonhg.NetBSD.org/src/rev/d9f628584c52
branches:  trunk
changeset: 772638:d9f628584c52
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Jan 10 10:09:49 2012 +0000

description:
Explicitly protect the kernel image against tampering by marking it R-X

diffstat:

 sys/arch/usermode/usermode/pmap.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 08df9ed23e29 -r d9f628584c52 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Tue Jan 10 08:42:22 2012 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Tue Jan 10 10:09:49 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.99 2012/01/09 14:58:15 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.99 2012/01/09 14:58:15 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100 2012/01/10 10:09:49 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -251,12 +251,9 @@
 #endif
 
        /* protect the current kernel section */
-#if 0
-       int err;
        err = thunk_mprotect((void *) kmem_k_start, kmem_k_end - kmem_k_start,
                THUNK_PROT_READ | THUNK_PROT_EXEC);
        assert(err == 0);
-#endif
 
        /* initialize counters */
        fpos = 0;



Home | Main Index | Thread Index | Old Index