Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2002 00:02:35 +0200 (CEST)
From:      Mark Kettenis <kettenis@chello.nl>
To:        freebsd-current@freebsd.org
Subject:   [PATCH] Fix PT_IO ptrace(2) request
Message-ID:  <200210142202.g9EM2Zt2004139@elgar.kettenis.dyndns.org>

next in thread | raw e-mail | index | archive | help
The new PT_IO ptrace(2) request doesn't work, since it doesn't release
a lock.  Since PT_IO is similar to PT_READ_D/PT_WRITE_D, I copied the
PROC_UNLOCK from there and inserted in the same location.  Patch,
against version 1.103 of sys_process.c, attached.

This patch is also available as:

   http://members.chello.nl/~m.m.kettenis/FreeBSD/5-current/pt_io.patch.

A bug report was filed using send-pr.  It has ID kern/44065.

Mark

P.S. GDB will soon use this request for its data transfers if it is
     available.  Really helps with large data transfers :-).  Would be
     great if this problem would be fixed first though.  We don't want
     GDB crashing the kernel, don't we ;-).

--- /usr/src/sys/kern/sys_process.c.orig	Wed Sep 11 10:13:54 2002
+++ /usr/src/sys/kern/sys_process.c	Mon Oct 14 23:22:01 2002
@@ -647,6 +647,7 @@ kern_ptrace(struct thread *td, int req, 
 		return (error);
 
 	case PT_IO:
+		PROC_UNLOCK(p);
 		piod = addr;
 		iov.iov_base = piod->piod_addr;
 		iov.iov_len = piod->piod_len;


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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