From 9fb6d40eb3d4a2da8f45187de773498b784596e6 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 15 Apr 2019 15:28:21 +0200 Subject: misc: add address sanitizer heap instrumentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce AddressSanitizer support: https://github.com/google/sanitizers/ This starts with heap instrumentation. vlib_buffer, bihash and stack instrumentation should follow. Type: feature Change-Id: I7f20e235b2f79db72efd0e756f22c75f717a9884 Signed-off-by: Benoît Ganne --- src/vcl/ldp_socket_wrapper.c | 8 ++++---- src/vcl/ldp_socket_wrapper.h | 16 +++------------- 2 files changed, 7 insertions(+), 17 deletions(-) (limited to 'src/vcl') diff --git a/src/vcl/ldp_socket_wrapper.c b/src/vcl/ldp_socket_wrapper.c index 81637deedfb..38ee297174c 100644 --- a/src/vcl/ldp_socket_wrapper.c +++ b/src/vcl/ldp_socket_wrapper.c @@ -394,7 +394,7 @@ swrap_load_lib_handle (enum swrap_lib lib) void *handle = NULL; int i; -#ifdef RTLD_DEEPBIND +#if defined(RTLD_DEEPBIND) && !defined(CLIB_SANITIZE_ADDR) flags |= RTLD_DEEPBIND; #endif @@ -547,7 +547,7 @@ libc_eventfd (int count, int flags) } #endif -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int +int libc_vfcntl (int fd, int cmd, va_list ap) { long int args[4]; @@ -569,7 +569,7 @@ libc_vfcntl (int fd, int cmd, va_list ap) } #ifdef HAVE_FCNTL64 -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int +int libc_vfcntl64 (int fd, int cmd, va_list ap) { long int args[4]; @@ -592,7 +592,7 @@ libc_vfcntl64 (int fd, int cmd, va_list ap) } #endif -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int +int libc_vioctl (int fd, int cmd, va_list ap) { long int args[4]; diff --git a/src/vcl/ldp_socket_wrapper.h b/src/vcl/ldp_socket_wrapper.h index b949d97f2f6..94529e3b744 100644 --- a/src/vcl/ldp_socket_wrapper.h +++ b/src/vcl/ldp_socket_wrapper.h @@ -90,13 +90,6 @@ #define DESTRUCTOR_ATTRIBUTE #endif -#define HAVE_ADDRESS_SANITIZER_ATTRIBUTE -#ifdef HAVE_ADDRESS_SANITIZER_ATTRIBUTE -#define DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE __attribute__((no_sanitize_address)) -#else -#define DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE -#endif - /* * IMPORTANT * @@ -127,14 +120,11 @@ int libc_dup2 (int oldfd, int newfd); int libc_eventfd (int count, int flags); #endif -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int -libc_vfcntl (int fd, int cmd, va_list ap); +int libc_vfcntl (int fd, int cmd, va_list ap); -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int -libc_vfcntl64 (int fd, int cmd, va_list ap); +int libc_vfcntl64 (int fd, int cmd, va_list ap); -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int -libc_vioctl (int fd, int cmd, va_list ap); +int libc_vioctl (int fd, int cmd, va_list ap); int libc_getpeername (int sockfd, struct sockaddr *addr, socklen_t * addrlen); -- cgit 1.2.3-korg