Module Name:    src
Committed By:   reinoud
Date:           Thu Aug 25 15:02:54 UTC 2011

Modified Files:
        src/sys/arch/usermode/usermode: trap.c

Log Message:
Check if we pee'd outside the box!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/usermode/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/usermode/trap.c
diff -u src/sys/arch/usermode/usermode/trap.c:1.4 src/sys/arch/usermode/usermode/trap.c:1.5
--- src/sys/arch/usermode/usermode/trap.c:1.4	Thu Aug 25 14:38:56 2011
+++ src/sys/arch/usermode/usermode/trap.c	Thu Aug 25 15:02:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.4 2011/08/25 14:38:56 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.5 2011/08/25 15:02:54 reinoud Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -125,6 +125,9 @@
 			kmem = 0;
 			vm_map = &vm->vm_map;
 		}
+		if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_ADDRESS)) {
+			panic("peeing outside the box!");
+		}
 
 		pcb->pcb_onfault = NULL;
 		/* XXX atype?? */

Reply via email to