Date: Mon, 14 Apr 2003 14:52:16 -0700 (PDT) From: Julian Elischer <julian@elischer.org> To: John Baldwin <jhb@FreeBSD.org> Cc: current@FreeBSD.org Subject: Re: Bug in rev 1.3 of sys/i386/linux/linux_ptrace.c Message-ID: <Pine.BSF.4.21.0304141449510.26224-100000@InterJet.elischer.org> In-Reply-To: <XFMail.20030414161206.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 14 Apr 2003, John Baldwin wrote:
> 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)?
probably the 2nd option, except that I am not 100% sure without looking
at the code, (which I don't have alot of time for right now)
(you will sympathise more after June 4) (my Birthday BTW) that
P_STOPPED_TRACE is fully implemented.. some other hands have been in
there and I haven't followed what they did..
>
> --
>
> John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
> "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0304141449510.26224-100000>
