This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: systemtap broken by USER_NS for now
- From: David Smith <dsmith at redhat dot com>
- To: "Alexander Y. Fomichev" <git dot user at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 31 May 2013 14:49:45 -0500
- Subject: Re: systemtap broken by USER_NS for now
- References: <CAChDUfQ0kQ+8AdyjmznGB6OaCZ8CxW99=TBWKnXfg8SA0hJ41g at mail dot gmail dot com> <519D3B58 dot 4020708 at redhat dot com>
On 05/22/2013 04:40 PM, David Smith wrote:
> On 05/22/2013 09:00 AM, Alexander Y. Fomichev wrote:
>> Hi
>>
>> for now user_ns unconditionally requires
>> CONFIG_UIDGID_STRICT_TYPE_CHECKS and the latter in turn breaks things
>> this way:
>>
>> typedef struct {
>> uid_t val;
>> } kuid_t;
>>
>> and so:
>>
>> stap # ./probe.stp
>> In file included from /usr/share/systemtap/runtime/linux/task_finder.c:17:0,
>> from /usr/share/systemtap/runtime/linux/runtime.h:188,
>> from /usr/share/systemtap/runtime/runtime.h:24,
>> from
>> /tmp/.private/root/stap7M7WmA/stap_6ce999ddb8d32c70dcbe287153f6957f_16537_src.c:22:
>> /usr/share/systemtap/runtime/linux/task_finder2.c: In function
>> '__stp_utrace_attach_match_filename':
>> /usr/share/systemtap/runtime/linux/task_finder2.c:816:11: error:
>> incompatible types when assigning to type 'uid_t' from type 'kuid_t'
>> tsk_euid = task_euid(tsk);
>> ^
>> .....................................................................
>>
>> It seems like fix is straightforward - just use from_kuid_munged to
>> get euid if CONFIG_UIDGID_STRICT_TYPE_CHECKS is defined. (really it
>> always works on latest kernels but breaks older ones). I've attached a
>> simple patch and it works for 3.9 (both with and without
>> STRICT_TYPE_CHECKS) but i'm not systemtap guy so i could be completely
>> wrong. Feel free to throw it out without reading :)
>>
>> --
>> Best regards.
>> Alexander Y. Fomichev <git.user@gmail.com>
>>
>
> Hmm, thanks for finding this and developing the patch. The tricky part
> here will be supporting 3.9 without breaking some of the earliest
> kernels we support (like RHEL4's 2.6.9).
>
> I'll look into your patch. I'm also wondering if some of the procfs
> fixes I just put in will work with CONFIG_UIDGID_STRICT_TYPE_CHECKS.
>
> I'll send out an update when I've figured something out.
I've checked your (a bit modified) work in as commit 8571631. As I
feared, I had to tweak it a bit to handle old kernels.
Thanks again.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)