summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-09 20:48:57 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-01-09 20:48:57 +0000
commitc88cb37963768d4ddbf78335478986b31599e25a (patch)
tree10e84550ed8f58e01db1598fbcff51eeb2667b86 /sys/arch/hppa
parent4a1f7ac239c46795bfd7a2da24f437093c928524 (diff)
on user trap space mismatch just kill the offender, panic the kernel otherwise
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r--sys/arch/hppa/hppa/trap.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index f320cbcd698..17c07d77df7 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: trap.c,v 1.57 2003/01/08 07:00:58 mickey Exp $ */
+/* $OpenBSD: trap.c,v 1.58 2003/01/09 20:48:56 mickey Exp $ */
/*
- * Copyright (c) 1998-2001 Michael Shalayeff
+ * Copyright (c) 1998-2003 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,8 +23,8 @@
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF MIND,
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -344,7 +344,7 @@ trap(type, frame)
*/
if (type & T_USER && va >= VM_MAXUSER_ADDRESS) {
sv.sival_int = va;
- trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv);
+ trapsignal(p, SIGSEGV, vftype, SEGV_ACCERR, sv);
break;
}
@@ -362,10 +362,14 @@ trap(type, frame)
map = &vm->vm_map;
if (map->pmap->pm_space != space) {
- printf("trap: space missmatch %d != %d\n",
- space, map->pmap->pm_space);
- /* actually dump the user, crap the kernel */
- goto dead_end;
+ if (map->pmap->pm_space != HPPA_SID_KERNEL) {
+ sv.sival_int = va;
+ trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv);
+ } else {
+ printf("trap: space missmatch %d != %d\n",
+ space, map->pmap->pm_space);
+ goto dead_end;
+ }
}
#ifdef TRAPDEBUG