Fix: plugin-dev.h: Disable address sanitizer on pointer array section variables
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Feb 2020 23:33:12 +0000 (18:33 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 2 Mar 2020 19:55:03 +0000 (14:55 -0500)
commitd91a8e262c3fb0154adbb71c56fc26fddcdf8f24
tree32fa18bcb770346115b8a628f7ef6a6aecca62b2
parent52ffe35392be0f1c9a7674aa7db9f925164268a9
Fix: plugin-dev.h: Disable address sanitizer on pointer array section variables

The plugin header declares pointer global variables in plugins meant to
be placed contiguously within their own sections, and then used as an
array of pointers when loading the plugin.

Clang Address Sanitizer adds redzones around each variable, thus leading
to detection of a global buffer overflow.

Those redzones should not be placed within this section, because it
defeats its purpose. Therefore, teach asan not to add redzones
around those variables with an attribute.

Note that there does not appear to be any issue with gcc (tested with
gcc-8 with address sanitization enabled), and gcc ignores the
no_sanitize_address attribute when applied to a global variable.

Fixes: #1231
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5488d61a7d714e6525a3a623d303c5fd30b76bc2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3102
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
include/babeltrace2/plugin/plugin-dev.h
This page took 0.026044 seconds and 4 git commands to generate.