This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug runtime/14244] New: Mode 0700 debugfs leads staprun to orphan modules


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]