From 45726c1dae2081b18b00c6698ca1fd3949d80133 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 24 Apr 2018 05:42:10 +0000 Subject: [PATCH] Relock PROC_LOCK before one failure case in ptrace_single_step(). The MIPS ptrace_single_step() unlocks the PROC_LOCK while reading and writing instructions from userland. One failure case was not reacquiring the lock before returning. --- sys/mips/mips/pm_machdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/mips/mips/pm_machdep.c b/sys/mips/mips/pm_machdep.c index d4571bb634e2..6477135b073e 100644 --- a/sys/mips/mips/pm_machdep.c +++ b/sys/mips/mips/pm_machdep.c @@ -260,6 +260,7 @@ ptrace_single_step(struct thread *td) if (td->td_md.md_ss_addr) { printf("SS %s (%d): breakpoint already set at %x (va %x)\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ + PROC_LOCK(p); return (EFAULT); } td->td_md.md_ss_addr = va;