From f712d514886149264901acd6ab776404092d9d67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 14 Sep 2019 16:02:33 -0400 Subject: [PATCH] sessiond: fix: possible unaligned access in packed structure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit '&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 --- src/bin/lttng-sessiond/consumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.34.1