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]

Re: ERROR: The effective user ID of staprun must be set to the root user.


Frank Ch. Eigler wrote:
> Jim Keniston <jkenisto@us.ibm.com> writes:
> 
>> [...]
>> Pass 5: starting run.
>> Error inserting module
>> '/tmp/stapiMOfTu/stap_3ef244575eb0700481e9d673c7d9d914_354.ko': File
>> exists
>> Retrying, after attempted removal of module
>> stap_3ef244575eb0700481e9d673c7d9d914_354 (rc 0)
> 
> This suggests that the module was left in memory after a previous run,
> as if "staprun -d" failed.

That is what is failing for me.  Here's what I'm seeing.

1) stap exec's staprun, which is a setuid root program
2) staprun (as root), inserts the module
3) staprun prepares to run stapio by calling 'setresuid()' to drop root
permissions
4) staprun execs stapio
5) stapio when finished, exec's "staprun -d" to remove the module
6) staprun, even though setuid root, still has the effective uid of the
user, not root.  So, it exits early without removing the module.  If I
remove the check for effective uid of root, removing the module fails.

I'm unsure as to what is going on here.  If I ifdef out the call to
setresuid(), it works (but of course stapio isn't designed to be run as
root).  I've written a small test program, but it works correctly.  So,
I'm unsure as to what we're doing that triggers this behavior.

-- 
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)


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