Fix: sessiond: RCU read lock imbalance on get trace chunk id error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Dec 2019 19:31:33 +0000 (14:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 9 Dec 2019 19:31:33 +0000 (14:31 -0500)
The error path when cmd_setup_relayd() fails to get the ID of a trace
chunk causes the RCU read lock to be released even though it was never
acquired.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I86aeb99e6cd6ba11634283ab7456a3760a0a6b0d

src/bin/lttng-sessiond/cmd.c

index 7c9477df938787407dc5eaf8b0c569ddfa0557a5..e067cb835e1a2739dfa35f83ce32a3d3c59b586a 100644 (file)
@@ -1185,6 +1185,7 @@ int cmd_setup_relayd(struct ltt_session *session)
 
        DBG("Setting relayd for session %s", session->name);
 
+       rcu_read_lock();
        if (session->current_trace_chunk) {
                enum lttng_trace_chunk_status status = lttng_trace_chunk_get_id(
                                session->current_trace_chunk, &current_chunk_id.value);
@@ -1198,8 +1199,6 @@ int cmd_setup_relayd(struct ltt_session *session)
                }
        }
 
-       rcu_read_lock();
-
        if (usess && usess->consumer && usess->consumer->type == CONSUMER_DST_NET
                        && usess->consumer->enabled) {
                /* For each consumer socket, send relayd sockets */
This page took 0.039552 seconds and 4 git commands to generate.