All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with application changing UID
@ 2019-09-24 14:32 Kramer, Zach
  0 siblings, 0 replies; 11+ messages in thread
From: Kramer, Zach @ 2019-09-24 14:32 UTC (permalink / raw)
  To: lttng-dev


[-- Attachment #1.1.1: Type: text/plain, Size: 2493 bytes --]

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 privileged user (500)
  5.  Creates LTTng session
     *   If session already exists, destroy it first
  6.  <if ‘systemctl stop’ is called>: Destroy session
     *   Otherwise it will be destroyed next daemon launch in step 5

This causes many conflicts with the trace folders that are created. Most of the time, LTTng creates a folder + metadata for both root and the user, then puts traces in the user folder. Other times, it may create a folder just for the user. This is seemingly random, since it’s a fresh device boot each time. If the daemon is launched directly (i.e. not from systemd), then the root folder gets the traces and the user folder gets the metadata. Here is a more detailed explanation:


Case
Command
Result

Comments
1
[Device boot]
systemctl start daemon
…../uid/500/32-bit --> has metadata and trace logs

Most times, this also happens:
…../uid/0/32-bit --> has metadata but no trace logs

[cid:image001.png@01D56F9D.AF158770]
Occasionally, the uid/0 folder is not created at all. This seems random, since this is tested by rebooting the device several times.
2
[Device boot]
systemctl start daemon
systemctl stop daemon

  *   This uses LTTng C-API to destroy session
…../uid/500/32-bit --> has metadata but the logs were cleared

Most times, this also happens:
…../uid/0/32-bit --> has metadata but no trace logs

[cid:image001.png@01D56F9D.AF158770]
The logs are cleared when ‘lttng destroy sess’ is called via the LTTng C-API. From my understanding, this should not happen.

Destroying the daemon from command line behaves properly. From my understanding, this should be practically the exact same command.
3
root@device: daemon

(launching via command-line)
When daemon is killed or session is stopped: mimics case 1

When daemon is alive:
…./uid/0/32-bit --> has trace logs but empty metadata

…./uid/500/32-bit --> has metadata but empty trace logs
[cid:image002.png@01D56F9D.AF158770]


Is this use-case supported?

Unfortunately, the logs are huge and contain sensitive information. If they can help a substantial amount, I can prune them.

Thanks and best regards,
Zach

[-- Attachment #1.1.2: Type: text/html, Size: 18835 bytes --]

[-- Attachment #1.2: image003.png --]
[-- Type: image/png, Size: 3141 bytes --]

[-- Attachment #1.3: image004.png --]
[-- Type: image/png, Size: 6313 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-10-07 13:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <SN4PR0601MB3614967ABCE12621B316C89D91840@SN4PR0601MB3614.namprd06.prod.outlook.com>
2019-09-24 15:07 ` Problem with application changing UID Jonathan Rajotte-Julien
2019-09-24 15:15 ` Jonathan Rajotte-Julien
     [not found] ` <20190924151515.GH187569@joraj-alpa>
2019-09-24 15:52   ` [EXTERNAL] " Kramer, Zach
     [not found] ` <20190924150754.GG187569@joraj-alpa>
2019-09-24 16:01   ` Kramer, Zach
     [not found]   ` <SN4PR0601MB36143DD719CB75559F9ABDD891840@SN4PR0601MB3614.namprd06.prod.outlook.com>
2019-09-24 16:06     ` Jonathan Rajotte-Julien
     [not found]     ` <20190924160604.GK187569@joraj-alpa>
2019-09-24 16:13       ` Kramer, Zach
     [not found]       ` <SN4PR0601MB361479BD3396866D29AA39F791840@SN4PR0601MB3614.namprd06.prod.outlook.com>
2019-09-24 18:45         ` Jonathan Rajotte-Julien
2019-09-27 14:07     ` Kramer, Zach
     [not found]     ` <SN4PR0601MB36145C3D44B796739CD7AF0691810@SN4PR0601MB3614.namprd06.prod.outlook.com>
2019-09-30 19:56       ` Mathieu Desnoyers
     [not found]       ` <1505194855.4263.1569873368480.JavaMail.zimbra@efficios.com>
2019-10-07 13:25         ` Kramer, Zach
2019-09-24 14:32 Kramer, Zach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.