From owner-freebsd-current@FreeBSD.ORG Mon Apr 14 13:12:09 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02C7837B401 for ; Mon, 14 Apr 2003 13:12:09 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FBE543FA3 for ; Mon, 14 Apr 2003 13:12:07 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 20878 invoked from network); 14 Apr 2003 20:12:14 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 14 Apr 2003 20:12:14 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3EKC4Ov067158; Mon, 14 Apr 2003 16:12:05 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 14 Apr 2003 16:12:06 -0400 (EDT) From: John Baldwin To: julian@FreeBSD.org cc: marcel@FreeBSD.org cc: current@FreeBSD.org Subject: Bug in rev 1.3 of sys/i386/linux/linux_ptrace.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2003 20:12:09 -0000 In the linux_ptrace() function there is the following code: case PTRACE_GETFPXREGS: { #ifdef CPU_ENABLE_SSE struct proc *p; struct thread *td2; ... /* not being traced... */ if ((p->p_flag & P_TRACED) == 0) { error = EPERM; goto fail; } /* not being traced by YOU */ if (p->p_pptr != td->td_proc) { error = EBUSY; goto fail; } /* not currently stopped */ if ((p->p_flag & (P_TRACED|P_WAITED)) == 0) { error = EBUSY; goto fail; } ... Now, since we've already checked P_TRACED above, this last check will never fail. The diff in rev 1.3 was: - if (p->p_stat != SSTOP || (p->p_flag & P_WAITED) == 0) { + if ((p->p_flag & (P_TRACED|P_WAITED)) == 0) { So should this be (P_STOPPED|P_WAITED) instead? Or maybe just (P_STOPPED_TRACE|P_WAITED)? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/