public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "mysecondaccountabc at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug tapsets/20075] New: target_set_pid() returns False when execve() syscall is successful
Date: Wed, 11 May 2016 01:24:00 -0000	[thread overview]
Message-ID: <bug-20075-6586@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=20075

            Bug ID: 20075
           Summary: target_set_pid() returns False when execve() syscall
                    is successful
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: mysecondaccountabc at gmail dot com
  Target Milestone: ---

Created attachment 9250
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9250&action=edit
Script to show the issue

When execve() is called and it returns without error, for some reason a call to
target_set_pid(pid()) in this context returns "False", wrongly indicating that
the pid doesn't descend from the target process. It causes that syscall be
discarded from the syscall trace.

I'm using a slightly modified version of "strace.stp" to show the issue, see
the attachment.

sudo stap my_strace.stp -w -c "sh -c /bin/ls" 

====
...

||OK_CALL 3||: target_set_pid(12701):1 target:12701
||OK_RETURN 3||: target_set_pid(12701):1 target:12701
Wed May 11 00:49:14 2016.822339 rt_sigprocmask(SIG_SETMASK, [EMPTY], 0x0, 8) =
0

||OK_CALL 3||: target_set_pid(12701):1 target:12701
||OK_RETURN 3||: target_set_pid(12701):1 target:12701
Wed May 11 00:49:14 2016.822364 execve("/usr/local/sbin/sh", ["sh", "-c",
"/bin/ls"], [/* 18 vars */]) = -2 (ENOENT)

...

||OK_CALL 3||: target_set_pid(12701):1 target:12701
||FILTERED_RETURN 2||: target_set_pid(12701):0
>>FILTERED_RETURN<<: sh[12701] execve("/bin/sh", ["sh", "-c", "/bin/ls"], [/* 18 vars */]) = 0

... 
====

As you can see above in the last three lines, when the successful execve is
called, the target_set_pid(pid()) call in the nd_syscall.*.return probe returns
False "target_set_pid(12701):0", causing the syscall to be dropped.

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2016-05-11  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  1:24 mysecondaccountabc at gmail dot com [this message]
2016-05-11 16:54 ` [Bug tapsets/20075] " jistone at redhat dot com
2016-05-16  7:45 ` mysecondaccountabc at gmail dot com
2016-05-16 15:08 ` fche at redhat dot com
2016-07-18 20:44 ` fche at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-20075-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).