summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-04 17:23:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-04 17:23:52 +0000
commita4c76ed47576b5cf16c9a37b0e1c6afc98d74bd5 (patch)
tree51f1196eb2a72f4788c62ffa692ecbcc7ab9387a /sys/arch
parentcbcd753c2665d057667a95580e9ba6d544b0ff51 (diff)
do not accidentally pass VM_PROT_WRITE|VM_PROT_READ
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/mvme68k/trap.c11
-rw-r--r--sys/arch/sparc/sparc/trap.c5
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c
index 07ba8798f4d..fa1dfbc9d99 100644
--- a/sys/arch/mvme68k/mvme68k/trap.c
+++ b/sys/arch/mvme68k/mvme68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.12 1997/02/04 12:29:20 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.13 1997/02/04 17:23:20 deraadt Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -549,7 +549,7 @@ copyfault:
register struct vmspace *vm = NULL;
register vm_map_t map;
int rv;
- vm_prot_t ftype;
+ vm_prot_t ftype, vftype;
extern vm_map_t kernel_map;
/* vmspace only significant if T_USER */
@@ -574,9 +574,10 @@ copyfault:
map = kernel_map;
else
map = &vm->vm_map;
- if (WRFAULT(code))
+ if (WRFAULT(code)) {
+ vftype = VM_PROT_WRITE;
ftype = VM_PROT_READ | VM_PROT_WRITE;
- else
+ } else
ftype = VM_PROT_READ;
va = trunc_page((vm_offset_t)v);
@@ -640,7 +641,7 @@ copyfault:
goto dopanic;
}
frame.f_pad = code & 0xffff;
- ucode = ftype;
+ ucode = vftype;
typ = SEGV_MAPERR;
i = SIGSEGV;
break;
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index 65569121f50..d3ebb6efb61 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -776,7 +776,7 @@ mem_access_fault4m(type, sfsr, sfva, afsr, afva, tf)
register struct vmspace *vm;
register vm_offset_t va;
register int rv;
- vm_prot_t ftype;
+ vm_prot_t ftype, vftype;
int onfault;
u_quad_t sticks;
#if DEBUG
@@ -928,6 +928,7 @@ static int lastdouble;
/* Now munch on protections... */
ftype = sfsr & SFSR_AT_STORE ? VM_PROT_READ|VM_PROT_WRITE:VM_PROT_READ;
+ vftype = sfsr & SFSR_AT_STORE ? VM_PROT_WRITE:VM_PROT_READ;
if (psr & PSR_PS) {
extern char Lfsbail[];
if (sfsr & SFSR_AT_TEXT || type == T_TEXTFAULT) {
@@ -1016,7 +1017,7 @@ kfault:
tf->tf_npc = onfault + 4;
return;
}
- trapsignal(p, SIGSEGV, ftype, SEGV_MAPERR, (caddr_t)sfva);
+ trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, (caddr_t)sfva);
}
out:
if ((psr & PSR_PS) == 0) {