* ptrace(PTRACE_SYSCALL) and data field
@ 2009-03-18 3:46 Mike Frysinger
[not found] ` <200903172346.32372.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2009-03-18 3:46 UTC (permalink / raw)
To: linux-man-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
the ptrace(2) page doesnt say anything about the data field (ignored or
otherwise). it seems to be ignored, but i didnt trace the kernel
exhaustively. the examples found via google shows that it's ignored. strace
usage seems odd (it passes in an irrelevant pointer), which would indicate
it's ignored as well ...
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <200903172346.32372.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
@ 2009-03-29 22:00 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291500s42eb323nd0d9ab8c1f7c4dbc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-30 0:38 ` Michael Kerrisk
1 sibling, 1 reply; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-29 22:00 UTC (permalink / raw)
To: Mike Frysinger; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Roland McGrath
Hi Mike,
(Roland may be able to help out here.)
On Wed, Mar 18, 2009 at 4:46 PM, Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> wrote:
> the ptrace(2) page doesnt say anything about the data field (ignored or
> otherwise). it seems to be ignored, but i didnt trace the kernel
> exhaustively. the examples found via google shows that it's ignored. strace
> usage seems odd (it passes in an irrelevant pointer), which would indicate
> it's ignored as well ...
It's true that this looks like a defect in the man page. But I'm not
sure what the fix is.
In the kernel source file kernel/ptrace.c, function ptrace_resume() we
have the line
child->exit_code = data;
which seems to be executed by the PRACE_SYSCALL code path. That
implies that data is treated as a signal number (like PTRACE_CONT).
That seems consistent with the following in the strace.c source file
of strace(1):
if (ptrace(PTRACE_SYSCALL, pid, (char *) 1,
WSTOPSIG(status)) < 0) {
perror("trace: ptrace(PTRACE_SYSCALL, ...)");
cleanup();
return -1;
}
Did I misunderstand something? Your thoughts?
Cheers,
Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <cfd18e0f0903291500s42eb323nd0d9ab8c1f7c4dbc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-29 22:35 ` Roland McGrath
[not found] ` <20090329223508.4521DFC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Roland McGrath @ 2009-03-29 22:35 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
All of the "resuming" ptracer requests treat the data argument the same.
Those are PTRACE_CONT, PTRACE_SYSCALL, PTRACE_*STEP, PTRACE_SYSEMU*.
The data argument is either 0 or a signal number.
The addr argument is ignored by all these.
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <20090329223508.4521DFC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
@ 2009-03-29 22:47 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291547s75749b01icbf99b6eab335cce-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-29 22:47 UTC (permalink / raw)
To: Roland McGrath; +Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 30, 2009 at 11:35 AM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> All of the "resuming" ptracer requests treat the data argument the same.
> Those are PTRACE_CONT, PTRACE_SYSCALL, PTRACE_*STEP, PTRACE_SYSEMU*.
> The data argument is either 0 or a signal number.
> The addr argument is ignored by all these.
Thanks for jumping in Roland.
So, for PTRACE_SYSCALL, the sameantics are like PTRACE_CONT, that is,
it is interpreted as a signal to be sent to the child. Right?
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <cfd18e0f0903291547s75749b01icbf99b6eab335cce-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-29 23:34 ` Roland McGrath
[not found] ` <20090329233402.9C695FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Roland McGrath @ 2009-03-29 23:34 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
> On Mon, Mar 30, 2009 at 11:35 AM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > All of the "resuming" ptracer requests treat the data argument the same.
> > Those are PTRACE_CONT, PTRACE_SYSCALL, PTRACE_*STEP, PTRACE_SYSEMU*.
> > The data argument is either 0 or a signal number.
> > The addr argument is ignored by all these.
>
> Thanks for jumping in Roland.
>
> So, for PTRACE_SYSCALL, the sameantics are like PTRACE_CONT, that is,
> it is interpreted as a signal to be sent to the child. Right?
For all those requests, yes.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <20090329233402.9C695FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
@ 2009-03-29 23:43 ` Michael Kerrisk
2009-03-29 23:54 ` Michael Kerrisk
1 sibling, 0 replies; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-29 23:43 UTC (permalink / raw)
To: Roland McGrath; +Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 30, 2009 at 12:34 PM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> On Mon, Mar 30, 2009 at 11:35 AM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > All of the "resuming" ptracer requests treat the data argument the same.
>> > Those are PTRACE_CONT, PTRACE_SYSCALL, PTRACE_*STEP, PTRACE_SYSEMU*.
>> > The data argument is either 0 or a signal number.
>> > The addr argument is ignored by all these.
>>
>> Thanks for jumping in Roland.
>>
>> So, for PTRACE_SYSCALL, the sameantics are like PTRACE_CONT, that is,
>> it is interpreted as a signal to be sent to the child. Right?
>
> For all those requests, yes.
Thanks for the confirmation, Roland.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <20090329233402.9C695FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
2009-03-29 23:43 ` Michael Kerrisk
@ 2009-03-29 23:54 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291654uea58687x5fb16d0b794e69cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 1 reply; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-29 23:54 UTC (permalink / raw)
To: Roland McGrath; +Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 30, 2009 at 12:34 PM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> On Mon, Mar 30, 2009 at 11:35 AM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> > All of the "resuming" ptracer requests treat the data argument the same.
>> > Those are PTRACE_CONT, PTRACE_SYSCALL, PTRACE_*STEP, PTRACE_SYSEMU*.
>> > The data argument is either 0 or a signal number.
>> > The addr argument is ignored by all these.
>>
>> Thanks for jumping in Roland.
>>
>> So, for PTRACE_SYSCALL, the sameantics are like PTRACE_CONT, that is,
>> it is interpreted as a signal to be sent to the child. Right?
>
> For all those requests, yes.
Hmmm. The existing man page includes this text:
PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP (since Linux 2.6.14)
...
(addr and data are ignored; ...
which according to what you've said (and also according to my reading
of the source), is wrong. Correct?
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <cfd18e0f0903291654uea58687x5fb16d0b794e69cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-30 0:07 ` Roland McGrath
[not found] ` <20090330000712.C0B54FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Roland McGrath @ 2009-03-30 0:07 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
> Hmmm. The existing man page includes this text:
>
> PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP (since Linux 2.6.14)
> ...
> (addr and data are ignored; ...
>
> which according to what you've said (and also according to my reading
> of the source), is wrong. Correct?
Yes, those also treat the signal argument like PTRACE_CONT et al.
Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <20090330000712.C0B54FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
@ 2009-03-30 0:31 ` Michael Kerrisk
0 siblings, 0 replies; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-30 0:31 UTC (permalink / raw)
To: Roland McGrath; +Cc: Mike Frysinger, linux-man-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 30, 2009 at 1:07 PM, Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> Hmmm. The existing man page includes this text:
>>
>> PTRACE_SYSEMU, PTRACE_SYSEMU_SINGLESTEP (since Linux 2.6.14)
>> ...
>> (addr and data are ignored; ...
>>
>> which according to what you've said (and also according to my reading
>> of the source), is wrong. Correct?
>
> Yes, those also treat the signal argument like PTRACE_CONT et al.
Thanks!
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: ptrace(PTRACE_SYSCALL) and data field
[not found] ` <200903172346.32372.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2009-03-29 22:00 ` Michael Kerrisk
@ 2009-03-30 0:38 ` Michael Kerrisk
1 sibling, 0 replies; 10+ messages in thread
From: Michael Kerrisk @ 2009-03-30 0:38 UTC (permalink / raw)
To: Mike Frysinger; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Roland McGrath
On Wed, Mar 18, 2009 at 4:46 PM, Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> wrote:
> the ptrace(2) page doesnt say anything about the data field (ignored or
> otherwise). it seems to be ignored, but i didnt trace the kernel
> exhaustively. the examples found via google shows that it's ignored. strace
> usage seems odd (it passes in an irrelevant pointer), which would indicate
> it's ignored as well ...
> -mike
Mike,
For man-pages-3.20, I've upated the PTRACE_SYSCALL documentation to
note that 'data' is used as for PTRACE_CONT. I've also added similar
text to PTRAC_SYSEMU*.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-03-30 0:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 3:46 ptrace(PTRACE_SYSCALL) and data field Mike Frysinger
[not found] ` <200903172346.32372.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2009-03-29 22:00 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291500s42eb323nd0d9ab8c1f7c4dbc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-29 22:35 ` Roland McGrath
[not found] ` <20090329223508.4521DFC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
2009-03-29 22:47 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291547s75749b01icbf99b6eab335cce-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-29 23:34 ` Roland McGrath
[not found] ` <20090329233402.9C695FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
2009-03-29 23:43 ` Michael Kerrisk
2009-03-29 23:54 ` Michael Kerrisk
[not found] ` <cfd18e0f0903291654uea58687x5fb16d0b794e69cf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-30 0:07 ` Roland McGrath
[not found] ` <20090330000712.C0B54FC2A8-nL1rrgvulkc2UH6IwYuUx0EOCMrvLtNR@public.gmane.org>
2009-03-30 0:31 ` Michael Kerrisk
2009-03-30 0:38 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox