Module Name:    src
Committed By:   matt
Date:           Wed Aug 13 21:10:31 UTC 2014

Modified Files:
        src/sys/arch/arm/arm: sig_machdep.c

Log Message:
When creating a mcontext, make sure the PSR we are saving is actually valid.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/arm/arm/sig_machdep.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/arm/arm/sig_machdep.c
diff -u src/sys/arch/arm/arm/sig_machdep.c:1.47 src/sys/arch/arm/arm/sig_machdep.c:1.48
--- src/sys/arch/arm/arm/sig_machdep.c:1.47	Sun Aug 18 06:28:18 2013
+++ src/sys/arch/arm/arm/sig_machdep.c	Wed Aug 13 21:10:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.47 2013/08/18 06:28:18 matt Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.48 2014/08/13 21:10:31 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.47 2013/08/18 06:28:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.48 2014/08/13 21:10:31 matt Exp $");
 
 #include <sys/mount.h>		/* XXX only needed by syscallargs.h */
 #include <sys/cpu.h>
@@ -184,6 +184,9 @@ cpu_getmcontext(struct lwp *l, mcontext_
 	gr[_REG_PC]   = tf->tf_pc;
 	gr[_REG_CPSR] = tf->tf_spsr;
 
+	KASSERTMSG(VALID_R15_PSR(gr[_REG_PC], gr[_REG_CPSR]), "%#x %#x",
+	    gr[_REG_PC], gr[_REG_CPSR]);
+
 	if ((ras_pc = (__greg_t)ras_lookup(l->l_proc,
 	    (void *) gr[_REG_PC])) != -1)
 		gr[_REG_PC] = ras_pc;

Reply via email to