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.9.13~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dee68e680fcb782b455daaeab744d5480580a3fd;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 960fe8e46..5f2c1e9b2 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1047,7 +1047,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; }