public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/14244] New: Mode 0700 debugfs leads staprun to orphan modules
@ 2012-06-14 21:49 jistone at redhat dot com
  2012-06-15  0:10 ` [Bug runtime/14244] " jistone at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jistone at redhat dot com @ 2012-06-14 21:49 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14244

             Bug #: 14244
           Summary: Mode 0700 debugfs leads staprun to orphan modules
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap@sourceware.org
        ReportedBy: jistone@redhat.com
    Classification: Unclassified


When debugfs has mode 0700, non-root users can't use systemtap, but staprun
only prints a bogus error about zombie modules and then leaves the module in
place without any connection.  See this thread:
http://sourceware.org/ml/systemtap/2012-q2/msg00243.html

The failure path is something like:

init_staprun()
  ->mountfs() // check debugfs, mount if not present
  ->insert_stap_module() // OK
  ->init_ctl_channel()
    ->open() // OK
    ->access() // FAILS, return -5
  ->remove_module()
    // first tries to open the ctl, to make sure it's not EBUSY and it's ours
    ->init_ctl_channel()
      ->open() // OK
      ->access() // FAILS, return -5
    err("not a zombie...") // and module is not removed

I think it will suffice to add a new check between mountfs() and
insert_stap_module(), simply access("/sys/kernel/debug", X_OK).  Then if the
user won't be able to traverse this path, we won't even try to load the module,
and we can print a suggestion to remount as perhaps 0711.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug runtime/14244] Mode 0700 debugfs leads staprun to orphan modules
  2012-06-14 21:49 [Bug runtime/14244] New: Mode 0700 debugfs leads staprun to orphan modules jistone at redhat dot com
@ 2012-06-15  0:10 ` jistone at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jistone at redhat dot com @ 2012-06-15  0:10 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14244

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Josh Stone <jistone at redhat dot com> 2012-06-15 00:09:47 UTC ---
commit d4caed28490b1480b29191c9d4c875a0f41175bd

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-15  0:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-14 21:49 [Bug runtime/14244] New: Mode 0700 debugfs leads staprun to orphan modules jistone at redhat dot com
2012-06-15  0:10 ` [Bug runtime/14244] " jistone at redhat dot com

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).