From: Jérémie Galarneau Date: Sat, 14 Sep 2019 20:02:33 +0000 (-0400) Subject: sessiond: fix: possible unaligned access in packed structure X-Git-Tag: v2.10.8~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6826a68d673ed0a5b678453e0677db66c79fce0b;p=lttng-tools.git sessiond: fix: possible unaligned access in packed structure '&rsock->sock.fd' is passed to consumer_send_fds and may result in an unaligned pointer value. Use the ALIGNED_CONST_PTR macro to create an aligned copy of the fd that is being passed. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 5cbd42f63..ab76f82e6 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1052,7 +1052,7 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, } DBG3("Sending relayd socket file descriptor to consumer"); - ret = consumer_send_fds(consumer_sock, &rsock->sock.fd, 1); + ret = consumer_send_fds(consumer_sock, ALIGNED_CONST_PTR(rsock->sock.fd), 1); if (ret < 0) { goto error; }