Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Apr 2018 05:42:10 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332910 - head/sys/mips/mips
Message-ID:  <201804240542.w3O5gAto084508@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Apr 24 05:42:10 2018
New Revision: 332910
URL: https://svnweb.freebsd.org/changeset/base/332910

Log:
  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.

Modified:
  head/sys/mips/mips/pm_machdep.c

Modified: head/sys/mips/mips/pm_machdep.c
==============================================================================
--- head/sys/mips/mips/pm_machdep.c	Tue Apr 24 05:33:17 2018	(r332909)
+++ head/sys/mips/mips/pm_machdep.c	Tue Apr 24 05:42:10 2018	(r332910)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804240542.w3O5gAto084508>