Fix: Cleanup local_apps sock_info in lttng_ust_cleanup
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 7 Jul 2015 18:35:54 +0000 (14:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Jul 2015 19:04:23 +0000 (15:04 -0400)
commitdda3bcd6707d6178eae7ac581cb13c0c307222a2
tree071ae920fb30fc8f1fb5bdb71afc10b65631d2d8
parent1ab81a2e6d6000cca6247387c3815da7d7408e9d
Fix: Cleanup local_apps sock_info in lttng_ust_cleanup

LTTng-UST will deadlock after a fork while waiting on the
"constructor_wait" semaphore if local apps, handled the session daemon
running under the current UID, are disabled or "not_allowed".

This deadlock can be triggered by setting an infinite registration
timeout, clearing the HOME environment variable and launching an app
which calls FORK(3). This will cause setup_local_apps() to fail to
determine the local_apps sock_path, thus leaving
local_apps.allowed == 0.

This, in turn, would cause lttng_ust_cleanup to skip the cleanup
of the local_apps sock_info after a fork,
leaving local_apps.constructor_sem_posted == 1. This would cause
handle_register_done() in the child to skip over the decrementation
of sem_count and post of the constructor_wait semaphore.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c
This page took 0.024778 seconds and 4 git commands to generate.