Prefaulting may generate asan error. Signed-off-by: Alex Michon <[email protected]> --- .mailmap | 1 + lib/eal/linux/eal_memalloc.c | 5 +++++ 2 files changed, 6 insertions(+)
diff --git a/.mailmap b/.mailmap index 3f3f0442e5..b1655a4080 100644 --- a/.mailmap +++ b/.mailmap @@ -60,6 +60,7 @@ Alexey Kardashevskiy <[email protected]> Alex Kiselev <[email protected]> <[email protected]> Alex Marginean <[email protected]> Alex Markuze <[email protected]> +Alex Michon <[email protected]> Alex Porosanu <[email protected]> Alex Rosenbaum <[email protected]> <[email protected]> Alex Vesker <[email protected]> diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c index e354efc95d..b9c631ea88 100644 --- a/lib/eal/linux/eal_memalloc.c +++ b/lib/eal/linux/eal_memalloc.c @@ -38,6 +38,8 @@ #include "eal_memcfg.h" #include "eal_private.h" +#include "malloc_elem.h" + const int anonymous_hugepages_supported = #ifdef MAP_HUGE_SHIFT 1; @@ -636,6 +638,9 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id, goto mapped; } + /* Ensure the prefault doesn't trigger ASAN errors */ + asan_set_zone(addr, alloc_sz, 0); + /* we need to trigger a write to the page to enforce page fault and * ensure that page is accessible to us, but we can't overwrite value * that is already there, so read the old value, and write itback. -- 2.17.1

