[lttng-dev] [PATCH lttng-ust] Add setuid wrappers for per-UID buffers
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Tue Jun 4 15:47:14 EDT 2019
----- On May 31, 2019, at 5:04 PM, Gabriel-Andrew Pollo-Guilbert gabriel.pollo-guilbert at efficios.com wrote:
> In case of a per-UID buffer, events following a change of user ID should be
> forwarded to buffers of the new UID. In order to do so, we add a wrapper around
> setuid(3), setreuid(3) and setresuid(2) that unregister and re-register the
> application from the session daemon.
>
> While there exist some other functions such as seteuid(3) or setfsuid(2), we
> don't need to add a wrapper for them since they do not edit the real user ID,
> the actual ID returned by getuid(3) and used for creating the buffers.
[...]
>
> diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt
> index 5c9c9f5d..b252c11d 100644
> --- a/doc/man/lttng-ust.3.txt
> +++ b/doc/man/lttng-ust.3.txt
> @@ -744,6 +744,17 @@ library before you start the application. Typical use cases
> include
> daemons closing all file descriptors after man:fork(2), and buggy
> applications doing ``double-closes''.
>
> +Using LTTng-UST with applications that change user
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +If your application is traced using per-UID buffers and changes user ID using
> +man:setuid(2), the library `liblttng-ust-setuid.so` needs to be preloaded
> +before starting the application with the `LD_PRELOAD` environment variable (see
> +man:ld.so(8)). This way, events generated after the UID change will be fowarded
fowarded -> forwarded
The rest looks good, please add this tag to your next round for this patch:
Acked-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
I'll wait until feedback is provided on the testing side (lttng-tools) and
the work on that front is finalized before merging this patch into lttng-ust.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list