Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Assert that the size of a trap handl...



details:   https://anonhg.NetBSD.org/src/rev/d7065ff70369
branches:  trunk
changeset: 349869:d7065ff70369
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Dec 26 21:25:08 2016 +0000

description:
Assert that the size of a trap handler does not exceed its room.

XXX
The debug exception is critical for ibm4xx. Since rev 1.24, we use the critical
trap hundler for it. Sorry for the wrong commit log for rev 1.24.

diffstat:

 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 423df3c86fcc -r d7065ff70369 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
--- a/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Mon Dec 26 21:16:06 2016 +0000
+++ b/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Mon Dec 26 21:25:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $  */
+/*     $NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $  */
 /*     Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.24 2016/12/26 20:28:00 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.25 2016/12/26 21:25:08 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -193,6 +193,7 @@
        }
 
        for (size_t i = 0; i < __arraycount(trap_table); i++) {
+               KASSERT(trap_table[i].exc_size <= 0x100);
                trap_copy(trap_table[i].exc_addr, trap_table[i].exc_vector,
                    trap_table[i].exc_size);
        }



Home | Main Index | Thread Index | Old Index