Fix: set FD_CLOEXEC on incoming FDs.
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 2 Mar 2020 19:21:33 +0000 (14:21 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 4 Mar 2020 15:08:09 +0000 (10:08 -0500)
commit6daf0c26e948e0f2270c283a6b311fba9591843d
tree01533748425c72148cc86278d790f8c56353cc0f
parent4f74bc5ef1bff1198cf47bd823cc5dc2e8fd9649
Fix: set FD_CLOEXEC on incoming FDs.

The stream shm FDs are allocated by the consumer process, and then
passed to the applications over unix sockets. When opening those
file descriptors on reception, the FD_CLOEXEC flag is not set.

In a fork + exec scenario, parent process streams shm FDs and channel
wake FDs are present in the resulting child process.

Set FD_CLOEXEC on reception (ustcomm_recv_fds_unix_sock) to
prevent such scenario.

Change-Id: Id58077b272be9c1ab239846639ffd8103b3d50f1
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-comm.c
libringbuffer/shm.c
This page took 0.025229 seconds and 4 git commands to generate.