From b2f09146c957f87edd431e75a24f8a456d539a02 Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 16 Dec 2019 15:37:28 +0100 Subject: misc: address sanitizer: fix instrumentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Type: fix Change-Id: I99e3951f8cfb7ab9d2f0a7dcee92199eab29043c Signed-off-by: Benoît Ganne --- src/vppinfra/dlmalloc.c | 2 ++ src/vppinfra/mem_dlmalloc.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vppinfra') diff --git a/src/vppinfra/dlmalloc.c b/src/vppinfra/dlmalloc.c index 451666e4c9c..13f0dff8203 100644 --- a/src/vppinfra/dlmalloc.c +++ b/src/vppinfra/dlmalloc.c @@ -4139,6 +4139,7 @@ int mspace_is_heap_object (mspace msp, void *p) return 0; } +CLIB_NOSANITIZE_ADDR void *mspace_least_addr (mspace msp) { mstate ms = (mstate) msp; @@ -4152,6 +4153,7 @@ void mspace_disable_expand (mspace msp) disable_expand (ms); } +CLIB_NOSANITIZE_ADDR int mspace_enable_disable_trace (mspace msp, int enable) { mstate ms = (mstate)msp; diff --git a/src/vppinfra/mem_dlmalloc.c b/src/vppinfra/mem_dlmalloc.c index 5628e2714c7..68901a5530a 100644 --- a/src/vppinfra/mem_dlmalloc.c +++ b/src/vppinfra/mem_dlmalloc.c @@ -215,12 +215,13 @@ clib_mem_init (void *memory, uword memory_size) else heap = create_mspace (memory_size, 1 /* locked */ ); + CLIB_MEM_POISON (mspace_least_addr (heap), mspace_footprint (heap)); + clib_mem_set_heap (heap); if (mheap_trace_main.lock == 0) clib_spinlock_init (&mheap_trace_main.lock); - CLIB_MEM_POISON (mspace_least_addr (heap), mspace_footprint (heap)); return heap; } -- cgit 1.2.3-korg