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: systemtap broken by USER_NS for now


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.

-- 
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]