]> granicus.if.org Git - strace/commitdiff
ptrace: do not print arguments of PTRACE_TRACEME request
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 12 May 2016 15:03:58 +0000 (15:03 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 12 May 2016 15:03:58 +0000 (15:03 +0000)
As kernel ignores arguments of PTRACE_TRACEME request,
we do not print them either.

* process.c (SYS_FUNC(ptrace)): If request is PTRACE_TRACEME,
return early with RVAL_DECODED.

process.c

index b2dfac193b05ce9e7520801975f346097b93bf03..f53c12e0d454f11e712ede37df483d6f0adcc939 100644 (file)
--- a/process.c
+++ b/process.c
@@ -91,6 +91,11 @@ SYS_FUNC(ptrace)
                /* request */
                printxval64(ptrace_cmds, request, "PTRACE_???");
 
+               if (request == PTRACE_TRACEME) {
+                       /* pid, addr, and data are ignored. */
+                       return RVAL_DECODED;
+               }
+
                /* pid */
                tprintf(", %d, ", pid);