[lttng-dev] [lttng-ust RFC] Add setuid wrapper for per-UID buffers

2019-05-21 Thread Gabriel-Andrew Pollo-Guilbert
In case of a per-UID buffers, events following a setuid() call should be fowarded to buffers of the new UID. In order to do so, we add a wrapper around setuid() that unregister and re-register the application from the session daemon. Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- Makefile.am

[lttng-dev] [lttng-ust RFC v2] Add setuid wrapper for per-UID buffers

2019-05-22 Thread Gabriel-Andrew Pollo-Guilbert
In case of a per-UID buffer, events following a setuid() call should be forwarded to buffers of the new UID. In order to do so, we add a wrapper around setuid() that unregister and re-register the application from the session daemon. Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- Makefile.am

Re: [lttng-dev] [lttng-ust RFC v2] Add setuid wrapper for per-UID buffers

2019-05-22 Thread Gabriel-Andrew Pollo-Guilbert
ot;Mathieu Desnoyers" To: "Gabriel-Andrew Pollo-Guilbert" Cc: "lttng-dev" Sent: Wednesday, May 22, 2019 12:24:22 PM Subject: Re: [lttng-dev] [lttng-ust RFC v2] Add setuid wrapper for per-UID buffers - On May 22, 2019, at 11:48 AM, Gabriel-Andrew Pollo-Guilbert ga

[lttng-dev] [lttng-ust RFC v3] Add setuid wrappers for per-UID buffers

2019-05-27 Thread Gabriel-Andrew Pollo-Guilbert
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. Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- Makefile.am

[lttng-dev] [PATCH lttng-ust] Ignore unexpected old state when nesting ust_mutex in the same thread

2019-05-28 Thread Gabriel-Andrew Pollo-Guilbert
fork(3) (with liblttng-ust-fork preloaded), the thread would lock before the fork(3) in ust_before_fork() and the child would lock again during lttng_after_fork_child(). Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- liblttng-ust/lttng-ust-comm.c | 12 +--- 1 file changed, 9

[lttng-dev] [PATCH lttng-ust] Add setuid wrappers for per-UID buffers

2019-05-31 Thread Gabriel-Andrew Pollo-Guilbert
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. Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- Makefile.am

[lttng-dev] [PATCH lttng-tools] Tests: add optional test for setuid() wrapper

2019-05-31 Thread Gabriel-Andrew Pollo-Guilbert
. It requires the LTTNG_ENABLE_DESTRUCTIVE_TESTS environment variable to be set to "will-break-my-system". Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- .gitignore| 1 + configure.ac | 1 + tests/destructive/M

[lttng-dev] [PATCH lttng-ust v2] Add setuid wrappers for per-UID buffers

2019-06-05 Thread Gabriel-Andrew Pollo-Guilbert
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. Signed-off-by: Gabriel-Andrew Pollo-Guilbert Acked-by: Mathieu Desnoyers --- Makefi

[lttng-dev] [PATCH lttng-ust v3] Add setuid wrappers for per-UID buffers

2019-06-11 Thread Gabriel-Andrew Pollo-Guilbert
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. Signed-off-by: Gabriel-Andrew Pollo-Guilbert Acked-by: Mathieu Desnoyers --- Makefi

[lttng-dev] [PATCH lttng-tools v2] Tests: add optional test for setuid() wrapper

2019-06-11 Thread Gabriel-Andrew Pollo-Guilbert
. It requires the LTTNG_ENABLE_DESTRUCTIVE_TESTS environment variable to be set to "will-break-my-system". Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- Changes since v1: * autotools: - add `HAVE_LIBLTTNG_USTCTL` check - remove `-llttng-ust-setuid` build flag * test-setu

[lttng-dev] [PATCH lttng-ust] Fix: wait for initial statedump before proceding to the main program

2019-07-16 Thread Gabriel-Andrew Pollo-Guilbert
In the case of short lived applications, a race condition may occur before the initial statedump is done and the end of the application. We force the statedump to occur before handing the control to the application. fixes #1190 Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- liblttng-ust

[lttng-dev] [PATCH lttng-ust] Fix: address GCC unaligned pointer warnings

2019-07-26 Thread Gabriel-Andrew Pollo-Guilbert
pointer to get a result. Rather than passing the pointer directly from the struct member, we get the result into a local storage, then write it in the struct. Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- liblttng-ust-comm/lttng-ust-comm.c | 26 +++--- liblttng-ust/lttng

[lttng-dev] [PATCH lttng-ust] Fix: remove uninitialised value

2019-07-29 Thread Gabriel-Andrew Pollo-Guilbert
Commit 973eac638e4fd introduces an uninitialised value that may prevent shared memory from being allocated. The compiler didn't give any warning because the pointer to the value is sent to a function that don't do anything with it. We simply pass NULL to that function. --- liblttng-ust/lttng-ust-c

[lttng-dev] [RFC PATCH lttng-modules] Fix: update sched prev_state instrumentation for kernel 4.14.0 and 4.20.0

2019-07-29 Thread Gabriel-Andrew Pollo-Guilbert
tracepoint Signed-off-by: Gabriel-Andrew Pollo-Guilbert --- instrumentation/events/lttng-module/sched.h | 47 - 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/instrumentation/events/lttng-module/sched.h b/instrumentation/events/lttng-module/sched.h index 77d77b2

[lttng-dev] [PATCH lttng-ust v2] Fix: wait for initial statedump before proceeding to the main program

2019-07-29 Thread Gabriel-Andrew Pollo-Guilbert
. Force the statedump to occur before handing the control to the application. Fixes #1190 Signed-off-by: Gabriel-Andrew Pollo-Guilbert Signed-off-by: Mathieu Desnoyers --- v2: * renamed constructor_sem_posted -> registration_done * add sem_count_initial_value * add ass

[lttng-dev] [PATCH lttng-ust] Fix: allocate ts_end in ringbuffer shared memory

2019-05-10 Thread Gabriel-Andrew Pollo-Guilbert
briel-Andrew Pollo-Guilbert --- libringbuffer/ring_buffer_backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index a0ef7446..431b8eae 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringb

[lttng-dev] [PATCH lttng-ust v2] Fix: allocate ts_end in ringbuffer shared memory

2019-05-10 Thread Gabriel-Andrew Pollo-Guilbert
5. lttng enable-event -u -a -c channel 6. lttng start After these steps, the following error message show should be thrown: Error: ask_channel_creation consumer command failed Error: Error creating UST channel "channel" on the consumer daemon Signed-off-by: Gabr