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.
This commit is contained in:
John Baldwin 2018-04-24 05:42:10 +00:00
parent 93fc184b82
commit 45726c1dae

View File

@ -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;