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.11.0-rc4~37 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bbe7b18f01d0b1c912d1db809ffd3256283dc3f5;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; }