From 2d7da3031c65c4569ff2428a7c2cad30007f3b50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 14 Apr 2022 17:36:54 -0400 Subject: [PATCH] Fix: liblttng-ctl: non-packed structure used for tracker serialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/tracker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/tracker.cpp b/src/common/tracker.cpp index 181a0a8c9..41e141afe 100644 --- a/src/common/tracker.cpp +++ b/src/common/tracker.cpp @@ -22,7 +22,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 */ @@ -32,7 +32,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)(std::is_signed::value ? (value_ptr)->u._signed : \ -- 2.34.1