From: Mathieu Desnoyers Date: Wed, 25 May 2016 21:17:41 +0000 (-0400) Subject: Fix: incorrect structure layout with mixed LGPL/non-LGPL objects X-Git-Tag: v2.8.1~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5afe6e62a872d26a84c7ea8a66b5fb8687c5676e;p=lttng-ust.git Fix: incorrect structure layout with mixed LGPL/non-LGPL objects Linking both _LGPL_SOURCE and non-_LGPL_SOURCE objects into the same module may result in corruption. If the tracepoint_dlopen object used is the one declared by a LGPL compile unit, a non-LGPL compile unit may try to initialize fields beyond the end of the structure. Signed-off-by: Jérémie Galarneau Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index 6e3faad6..a7305603 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -218,11 +218,9 @@ struct lttng_ust_tracepoint_dlopen { int (*tracepoint_register_lib)(struct lttng_ust_tracepoint * const *tracepoints_start, int tracepoints_count); int (*tracepoint_unregister_lib)(struct lttng_ust_tracepoint * const *tracepoints_start); -#ifndef _LGPL_SOURCE void (*rcu_read_lock_sym_bp)(void); void (*rcu_read_unlock_sym_bp)(void); void *(*rcu_dereference_sym_bp)(void *p); -#endif }; extern struct lttng_ust_tracepoint_dlopen tracepoint_dlopen;