[v2] eal/arm64: support ASan
Checks
Commit Message
This patch defines ASAN_SHADOW_OFFSET for arm64 according to the ASan
documentation. This offset should cover all arm64 VMAs supported by
ASan.
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
Changes since v1:
- changed the subject
- rewrite checks in "elif" manner
---
config/meson.build | 2 +-
doc/guides/prog_guide/asan.rst | 2 +-
lib/eal/common/malloc_elem.h | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
@@ -428,7 +428,7 @@ if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address
dpdk_extra_ldflags += '-lasan'
endif
- if is_linux and arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
+ if is_linux and arch_subdir in ['x86', 'arm'] and dpdk_conf.get('RTE_ARCH_64')
dpdk_conf.set10('RTE_MALLOC_ASAN', true)
endif
endif
@@ -33,7 +33,7 @@ Example::
"stty echo" command when an error occurs.
ASan is aware of DPDK memory allocations, thanks to added instrumentation.
-This is only enabled on x86_64 at the moment.
+This is enabled on x86_64 and arm64 at the moment.
Other architectures may have to define ASAN_SHADOW_OFFSET.
Example heap-buffer-overflow error
@@ -106,6 +106,8 @@ malloc_elem_cookies_ok(const struct malloc_elem *elem)
#ifdef RTE_ARCH_X86_64
#define ASAN_SHADOW_OFFSET 0x00007fff8000
+#elif defined(RTE_ARCH_ARM64)
+#define ASAN_SHADOW_OFFSET 0x001000000000
#endif
#define ASAN_SHADOW_GRAIN_SIZE 8