mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 12:40:00 -04:00
Merge branch '787-disable-rtld_deepbind-when-compiled-under-asan' into 'master'
Resolve "RTLD_DEEPBIND and AddressSanitizer aren't compatible" Closes #787 See merge request isc-projects/bind9!1251
This commit is contained in:
commit
35d495db68
4 changed files with 8 additions and 3 deletions
|
|
@ -257,7 +257,7 @@ dlopen_dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
|||
/* Open the library */
|
||||
dlopen_flags = RTLD_NOW|RTLD_GLOBAL;
|
||||
|
||||
#ifdef RTLD_DEEPBIND
|
||||
#if defined(RTLD_DEEPBIND) && !__ADDRESS_SANITIZER__
|
||||
/*
|
||||
* If RTLD_DEEPBIND is available then use it. This can avoid
|
||||
* issues with a module using a different version of a system
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||
instname, filename);
|
||||
|
||||
flags = RTLD_NOW|RTLD_LOCAL;
|
||||
#ifdef RTLD_DEEPBIND
|
||||
#if defined(RTLD_DEEPBIND) && !__ADDRESS_SANITIZER__
|
||||
flags |= RTLD_DEEPBIND;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -206,6 +206,11 @@
|
|||
#define __has_feature(x) 0
|
||||
#endif
|
||||
|
||||
/* GCC defines __ADDRESS_SANITIZER__, so reuse the macro for clang */
|
||||
#if __has_feature(address_sanitizer)
|
||||
#define __ADDRESS_SANITIZER__
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6)
|
||||
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
|
||||
#elif __has_feature(c_static_assert)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ load_plugin(isc_mem_t *mctx, const char *modpath, ns_plugin_t **pluginp) {
|
|||
REQUIRE(pluginp != NULL && *pluginp == NULL);
|
||||
|
||||
flags = RTLD_LAZY | RTLD_LOCAL;
|
||||
#ifdef RTLD_DEEPBIND
|
||||
#if defined(RTLD_DEEPBIND) && !__ADDRESS_SANITIZER__
|
||||
flags |= RTLD_DEEPBIND;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue