[lttng-dev] Problem with application changing UID

2019-09-24 Thread Kramer, Zach
Hi, Is LTTng intended to support userspace applications that change their UID at run-time? As in, is there an expected behavior for when this happens? For example: 1. Embedded device boots 2. My daemon is launched as root via systemd 3. Runs privileged code 4. Changes UID to a less

[lttng-dev] [PATCH lttng-tools] Fix: use newly created event filter for condition check

2019-09-24 Thread Jonathan Rajotte
4c5e3185d75ffe90b04107744693964d9051fb6b introduced a regression while fixing the filter and filter_expression ownership. Setting the "filter" object to NULL prevents the call to add_filter_app_ctx when needed. We use the filter from the newly created event to perform the check and the call to ad

Re: [lttng-dev] Problem with application changing UID

2019-09-24 Thread Jonathan Rajotte-Julien
Hi Zach, Thanks for reaching out. lttng-ust does not support the change of uid once the application is registered to the lttng-sessiond daemon. I think that we use the uid received on registration for all subsequent operations. Gabriel Pollo-Guilbert actually worked on this this summer. You can

Re: [lttng-dev] [PATCH lttng-tools] Fix: use newly created event filter for condition check

2019-09-24 Thread Mathieu Desnoyers
- On Sep 24, 2019, at 10:53 AM, Jonathan Rajotte jonathan.rajotte-jul...@efficios.com wrote: > 4c5e3185d75ffe90b04107744693964d9051fb6b introduced a regression while > fixing the filter and filter_expression ownership. What is this commit ? I'm having trouble finding it. Can you double-check

Re: [lttng-dev] Problem with application changing UID

2019-09-24 Thread Jonathan Rajotte-Julien
On Tue, Sep 24, 2019 at 02:32:41PM +, Kramer, Zach wrote: > Hi, > > Is LTTng intended to support userspace applications that change their UID at > run-time? As in, is there an expected behavior for when this happens? > > For example: > > 1. Embedded device boots > 2. My daemon is laun

[lttng-dev] [PATCH lttng-tools v2] Fix: use newly created event filter for condition check

2019-09-24 Thread Jonathan Rajotte
The following commit introduced a regression while fixing the filter and filter_expression ownership. commit b0a23296344e57bd2e48e62ec2d7e0d8a38661bb Author: Jérémie Galarneau Date: Sat Jan 12 14:53:56 2019 -0500 Fix: leak of filter bytecode and expression on agent event re-enable The

Re: [lttng-dev] [PATCH lttng-tools] Fix: use newly created event filter for condition check

2019-09-24 Thread Jonathan Rajotte-Julien
> > 4c5e3185d75ffe90b04107744693964d9051fb6b introduced a regression while > > fixing the filter and filter_expression ownership. > > What is this commit ? I'm having trouble finding it. Can you double-check and > provide the commit Subject as well ? Seems like I copied the parent tree commit. S

Re: [lttng-dev] [PATCH lttng-tools v2] Fix: use newly created event filter for condition check

2019-09-24 Thread Jonathan Rajotte-Julien
Do not review, this include a change that should not be part of this commit. On Tue, Sep 24, 2019 at 11:21:14AM -0400, Jonathan Rajotte wrote: > The following commit introduced a regression while > fixing the filter and filter_expression ownership. > > commit b0a23296344e57bd2e48e62ec2d7e0d8a3866

[lttng-dev] [PATCH lttng-tools v3] Fix: use newly created event filter for condition check

2019-09-24 Thread Jonathan Rajotte
The following commit introduced a regression while fixing the filter and filter_expression ownership. commit b0a23296344e57bd2e48e62ec2d7e0d8a38661bb Author: Jérémie Galarneau Date: Sat Jan 12 14:53:56 2019 -0500 Fix: leak of filter bytecode and expression on agent event re-enable The

Re: [lttng-dev] [EXTERNAL] Re: Problem with application changing UID

2019-09-24 Thread Kramer, Zach
Hi, lttng-sessiond is launched in step 1 (with adequate delay before my daemon). The versions of LTTng are from poky/sumo: * lttng-modules 2.10.9 * lttng-tools 2.9.11 * lttng-ust 2.10.3 Unfortunately, the destroy session call that clears my logs is very likely tied to the systemd service file

Re: [lttng-dev] [EXTERNAL] Re: Problem with application changing UID

2019-09-24 Thread Kramer, Zach
Hi, Thanks for the quick response! This looks interesting -- I will experiment with it and come back with any results. Cheers, Zach -Original Message- From: Jonathan Rajotte-Julien Sent: Tuesday, September 24, 2019 5:08 PM To: Kramer, Zach Cc: lttng-dev@lists.lttng.org Subject: [EXT

Re: [lttng-dev] [EXTERNAL] Re: Problem with application changing UID

2019-09-24 Thread Jonathan Rajotte-Julien
Hi Zach, Forgot to add that you might want to look at available UST wrappers depending on the nature of your daemon application. https://lttng.org/docs/v2.10/#doc-using-lttng-ust-with-daemons https://lttng.org/docs/v2.10/#doc-liblttng-ust-fd Cheers -- Jonathan Rajotte-Julien EfficiOS _

Re: [lttng-dev] [EXTERNAL] Re: Problem with application changing UID

2019-09-24 Thread Kramer, Zach
Hi Jonathan, Thanks for the extra info. We do indeed fork without a following exec call and I experimented with this preloading recently. When I experimented, I noticed no difference in the tracing when I preload liblttng-ust-fork.so. What exactly is the consequence of not doing this? Thanks!

Re: [lttng-dev] [EXTERNAL] Re: Problem with application changing UID

2019-09-24 Thread Jonathan Rajotte-Julien
On Tue, Sep 24, 2019 at 04:13:13PM +, Kramer, Zach wrote: > Hi Jonathan, > > Thanks for the extra info. We do indeed fork without a following exec call and > I experimented with this preloading recently. When I experimented, I noticed > no difference in the tracing when I preload liblttng-ust-