]> granicus.if.org Git - strace/commitdiff
ptrace: do not print addr and data arguments of PTRACE_ATTACH-like requests
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 12 May 2016 15:10:41 +0000 (15:10 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 12 May 2016 15:10:41 +0000 (15:10 +0000)
As kernel ignores addr and data arguments of PTRACE_ATTACH,
PTRACE_INTERRUPT, PTRACE_KILL, and PTRACE_LISTEN request,
we do not print them either.

* process.c (SYS_FUNC(ptrace)): After printing pid argument, return
RVAL_DECODED if request is one of PTRACE_ATTACH, PTRACE_INTERRUPT,
PTRACE_KILL, or PTRACE_LISTEN.

process.c

index f53c12e0d454f11e712ede37df483d6f0adcc939..620cc1f437d4c316fcacc3596008bcb9e3812de1 100644 (file)
--- a/process.c
+++ b/process.c
@@ -97,24 +97,34 @@ SYS_FUNC(ptrace)
                }
 
                /* pid */
-               tprintf(", %d", pid);
+               tprintf(", %d", pid);
 
                /* addr */
                switch (request) {
+               case PTRACE_ATTACH:
+               case PTRACE_INTERRUPT:
+               case PTRACE_KILL:
+               case PTRACE_LISTEN:
+                       /* addr and data are ignored */
+                       return RVAL_DECODED;
                case PTRACE_PEEKUSER:
                case PTRACE_POKEUSER:
+                       tprints(", ");
                        print_user_offset_addr(addr);
                        break;
                case PTRACE_GETREGSET:
                case PTRACE_SETREGSET:
+                       tprints(", ");
                        printxval(nt_descriptor_types, addr, "NT_???");
                        break;
                default:
+                       tprints(", ");
                        printaddr(addr);
                }
 
                tprints(", ");
 
+               /* data */
                switch (request) {
 #ifndef IA64
                case PTRACE_PEEKDATA: