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.12.0-rc1~384 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f712d514886149264901acd6ab776404092d9d67;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 46ee31cc2..d376c9ee3 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1190,7 +1190,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; }