diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-06-28 18:15:38 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-01 09:37:34 +0200 |
commit | 736172d23d99f90420b917ec8b7999bd56e7ca1c (patch) | |
tree | 182a049bb2bfdd6085c0be081f3745bd99f5b403 | |
parent | 3c472909c05e2c79395ea2bed2aa5a43c689b370 (diff) | |
download | php-git-736172d23d99f90420b917ec8b7999bd56e7ca1c.tar.gz |
Disable RTLD_DEEPBIND under memory sanitizer
This was already done for address sanitizer.
-rw-r--r-- | Zend/zend_cpuinfo.h | 3 | ||||
-rw-r--r-- | Zend/zend_portability.h | 17 |
2 files changed, 8 insertions, 12 deletions
diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index 009944e712..c0949e3638 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -103,9 +103,6 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature); #ifndef __has_attribute # define __has_attribute(x) 0 #endif -#ifndef __has_feature -# define __has_feature(x) 0 -#endif /* Address sanitizer is incompatible with ifunc resolvers, so exclude the * CPU support helpers from asan. diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 9416a362e3..89173642d2 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -86,6 +86,9 @@ #ifndef __has_builtin # define __has_builtin(x) 0 #endif +#ifndef __has_feature +# define __has_feature(x) 0 +#endif #if defined(ZEND_WIN32) && !defined(__clang__) # define ZEND_ASSUME(c) __assume(c) @@ -123,10 +126,8 @@ #if defined(HAVE_LIBDL) && !defined(ZEND_WIN32) -# if defined(__has_feature) -# if __has_feature(address_sanitizer) -# define __SANITIZE_ADDRESS__ -# endif +# if __has_feature(address_sanitizer) +# define __SANITIZE_ADDRESS__ # endif # ifndef RTLD_LAZY @@ -145,7 +146,7 @@ # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) -# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) +# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer) # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND) # else # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL) @@ -526,10 +527,8 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */ /* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver * is marked as no_sanitize("memory") it will still be instrumented and crash. */ -#if defined(__has_feature) -# if __has_feature(memory_sanitizer) -# undef HAVE_FUNC_ATTRIBUTE_IFUNC -# endif +#if __has_feature(memory_sanitizer) +# undef HAVE_FUNC_ATTRIBUTE_IFUNC #endif #if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET) |