From: Jérémie Galarneau Date: Sat, 14 Sep 2019 19:58:17 +0000 (-0400) Subject: sessiond: fix: possible unaligned access in packed structure X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=07aa2e420d253caa8a1ac38c5619955acbd6e63f sessiond: fix: possible unaligned access in packed structure Use a temporary relayd_session_id variable to prevent an unaligned access in the packed communication structure 'msg'. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 53f7c3946..46ee31cc2 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1151,9 +1151,10 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, if (type == LTTNG_STREAM_CONTROL) { char output_path[LTTNG_PATH_MAX] = {}; + uint64_t relayd_session_id; ret = relayd_create_session(rsock, - &msg.u.relayd_sock.relayd_session_id, + &relayd_session_id, session_name, hostname, base_path, session_live_timer, consumer->snapshot, session_id, @@ -1166,6 +1167,7 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, (void) relayd_close(rsock); goto error; } + msg.u.relayd_sock.relayd_session_id = relayd_session_id; DBG("Created session on relay, output path reply: %s", output_path); }