From: Jérémie Galarneau Date: Thu, 14 Apr 2022 21:36:54 +0000 (-0400) Subject: Fix: liblttng-ctl: non-packed structure used for tracker serialization X-Git-Tag: v2.12.12~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9ea6839ddbeb9ef76c62ee8ad5d2dcfb7eeefad2;p=lttng-tools.git Fix: liblttng-ctl: non-packed structure used for tracker serialization Using unpacked structures in liblttng-ctl's protocol can cause issues when mixing sessiond and client of different bitness. In this specific case I doubt it causes a problem, but it could rightfully do on some architectures. Signed-off-by: Jérémie Galarneau Change-Id: Ie17096a55a4b7508c604e184cae877b83df6e451 --- diff --git a/src/common/tracker.c b/src/common/tracker.c index 29249d528..734fbd309 100644 --- a/src/common/tracker.c +++ b/src/common/tracker.c @@ -20,7 +20,7 @@ struct process_attr_tracker_values_comm_header { uint32_t count; -}; +} LTTNG_PACKED; struct process_attr_tracker_value_comm { /* enum lttng_process_attr_value_type */ @@ -30,7 +30,7 @@ struct process_attr_tracker_value_comm { /* Includes the '\0' terminator. */ uint32_t name_len; } value; -}; +} LTTNG_PACKED; #define GET_INTEGRAL_COMM_VALUE(value_ptr, as_type) \ ((as_type)(is_signed(as_type) ? (value_ptr)->u._signed : \