summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-07-02 18:37:33 +0000
committermiod <miod@openbsd.org>2014-07-02 18:37:33 +0000
commit218534e2ec0d10093202fd2f847f1742ce50ecb3 (patch)
tree5eceda76966d61827c6bfb51efbae9623212d41f
parentOn IP28, ignore (as in, do not report) GIO bus errors where the address isn't (diff)
downloadwireguard-openbsd-218534e2ec0d10093202fd2f847f1742ce50ecb3.tar.xz
wireguard-openbsd-218534e2ec0d10093202fd2f847f1742ce50ecb3.zip
Make sure the kernel lock is held when invoking process_domem(); fixes
ptrace operation on MP kernels.
-rw-r--r--sys/arch/alpha/alpha/trap.c4
-rw-r--r--sys/arch/m88k/m88k/trap.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c
index 9d58190144d..db7a0adae05 100644
--- a/sys/arch/alpha/alpha/trap.c
+++ b/sys/arch/alpha/alpha/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.74 2014/05/11 00:12:43 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.75 2014/07/02 18:37:33 miod Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
@@ -339,7 +339,9 @@ trap(a0, a1, a2, entry, framep)
case ALPHA_IF_CODE_BUGCHK:
#ifdef PTRACE
if (p->p_md.md_flags & (MDP_STEP1|MDP_STEP2)) {
+ KERNEL_LOCK();
process_sstep(p, 0);
+ KERNEL_UNLOCK();
p->p_md.md_tf->tf_regs[FRAME_PC] -= 4;
}
#endif
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index 5d2ebe03784..2c3eb35013b 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.99 2014/07/01 20:26:09 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.100 2014/07/02 18:37:34 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -543,6 +543,7 @@ user_fault:
}
/* restore original instruction and clear breakpoint */
+ KERNEL_LOCK();
if (p->p_md.md_bp0va == pc) {
ss_put_value(p, pc, p->p_md.md_bp0save);
p->p_md.md_bp0va = 0;
@@ -551,6 +552,7 @@ user_fault:
ss_put_value(p, pc, p->p_md.md_bp1save);
p->p_md.md_bp1va = 0;
}
+ KERNEL_UNLOCK();
frame->tf_sxip = pc | NIP_V;
sig = SIGTRAP;
@@ -1073,6 +1075,7 @@ m88110_user_fault:
}
/* restore original instruction and clear breakpoint */
+ KERNEL_LOCK();
if (p->p_md.md_bp0va == pc) {
ss_put_value(p, pc, p->p_md.md_bp0save);
p->p_md.md_bp0va = 0;
@@ -1081,6 +1084,7 @@ m88110_user_fault:
ss_put_value(p, pc, p->p_md.md_bp1save);
p->p_md.md_bp1va = 0;
}
+ KERNEL_UNLOCK();
sig = SIGTRAP;
fault_type = TRAP_BRKPT;