diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-04-15 15:28:21 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-11-27 10:50:28 +0000 |
commit | 9fb6d40eb3d4a2da8f45187de773498b784596e6 (patch) | |
tree | e785ebfbe73b847146debb2dae4a4304c51aa9cf /src/vcl | |
parent | 99fbf0574f099f09b7b46dcabe5bb50d78091dce (diff) |
misc: add address sanitizer heap instrumentation
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 <bganne@cisco.com>
Diffstat (limited to 'src/vcl')
-rw-r--r-- | src/vcl/ldp_socket_wrapper.c | 8 | ||||
-rw-r--r-- | src/vcl/ldp_socket_wrapper.h | 16 |
2 files changed, 7 insertions, 17 deletions
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); |