sessiond: fix: possible unaligned access in packed structure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 20:02:33 +0000 (16:02 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Sep 2019 19:55:46 +0000 (15:55 -0400)
'&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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c

index 960fe8e46439a6447c17198f0732c08b507bee4a..5f2c1e9b217ef1fc714823f75c8ba0689bb3ad05 100644 (file)
@@ -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;
        }
This page took 0.026138 seconds and 4 git commands to generate.