From 7f3d3ba1a61f28a951ca5fbe59ed15c7ce55219c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 22 Sep 2014 12:49:47 +0200 Subject: bus: align kdbus ioctl parameters to 8byte All kdbus ioctl arguments must be 8byte aligned. Make sure we use alloca_align() and _alignas_(8) in all situations where gcc doesn't guarantee 8-byte alignment. Note that objects on the stack are always 8byte aligned as we put _alignas_(8) into the structure definition in kdbus.h. --- src/libsystemd/sd-bus/bus-message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsystemd/sd-bus/bus-message.c') diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 1fa3ad2611..400ba307bc 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -128,7 +128,7 @@ static void message_free(sd_bus_message *m) { message_reset_parts(m); if (m->release_kdbus) { - uint64_t off; + uint64_t off _alignas_(8); off = (uint8_t *)m->kdbus - (uint8_t *)m->bus->kdbus_buffer; ioctl(m->bus->input_fd, KDBUS_CMD_FREE, &off); -- cgit v1.2.3-54-g00ecf