Date: Mon, 14 Oct 2002 23:46:22 +0200 (CEST) From: Mark Kettenis <kettenis@chello.nl> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/44065: [PATCH] Fix PT_IO ptrace(2) request Message-ID: <200210142146.g9ELkMMc004077@elgar.kettenis.dyndns.org>
next in thread | raw e-mail | index | archive | help
>Number: 44065 >Category: kern >Synopsis: [PATCH] Fix PT_IO ptrace(2) request >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 14 14:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Mark Kettenis >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD elgar.kettenis.dyndns.org 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Mon Oct 14 23:23:21 CEST 2002 kettenis@elgar.kettenis.dyndns.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: The new PT_IO ptrace(2) request doesn't work, since it doesn't release a lock. >How-To-Repeat: struct ptrace_io_desc piod; ptrace(PT_IO, pid, &piod, 0); >Fix: 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. Mark P.S. GDB will soon use this request for its data transfers if it is available. Really helps with large data transfers :-). --- /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; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210142146.g9ELkMMc004077>