summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/socket_api.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-10-20 14:31:55 +0200
committerDamjan Marion <dmarion@me.com>2020-10-21 11:04:07 +0000
commitdf601ae2d16ed127a9506a7a865484632ee1afe1 (patch)
tree6cd0860085ae9b74dbe5b41227541b3f4912fe63 /src/vlibmemory/socket_api.c
parent568617bfe6d45c0ebe0f4eb45fdaca6a3a90134e (diff)
svm: fix ASAN annotations for external chunks
Chunks can be allocated from another process. We need to manually mark them as accessible for ASAN. Type: fix Change-Id: Ifbeef3346e9cee2c1231f80cbcf7f9673b5b54be Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vlibmemory/socket_api.c')
-rw-r--r--src/vlibmemory/socket_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c
index 51c52b43e7a..d724164d213 100644
--- a/src/vlibmemory/socket_api.c
+++ b/src/vlibmemory/socket_api.c
@@ -645,6 +645,11 @@ vl_api_sock_init_shm_t_handler (vl_api_sock_init_shm_t * mp)
if ((rv = ssvm_server_init_memfd (memfd)))
goto reply;
+ /* delete the unused heap created in ssvm_server_init_memfd and mark it
+ * accessible again for ASAN */
+ clib_mem_destroy_heap (memfd->sh->heap);
+ CLIB_MEM_UNPOISON ((void *) memfd->sh->ssvm_va, memfd->ssvm_size);
+
/* Remember to close this fd when the socket connection goes away */
vec_add1 (regp->additional_fds_to_close, memfd->fd);