diff options
Diffstat (limited to 'src/vlibmemory/memory_client.c')
-rw-r--r-- | src/vlibmemory/memory_client.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index c61c3cbdd51..bb377f1b531 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -97,6 +97,13 @@ vl_api_name_and_crc_free (void) hash_free (am->msg_index_by_name_and_crc); } +CLIB_NOSANITIZE_ADDR static void +VL_API_VEC_UNPOISON (const void *v) +{ + const vec_header_t *vh = &((vec_header_t *) v)[-1]; + CLIB_MEM_UNPOISON (vh, sizeof (*vh) + vec_len (v)); +} + static void vl_api_memclnt_create_reply_t_handler (vl_api_memclnt_create_reply_t * mp) { @@ -121,6 +128,8 @@ vl_api_memclnt_create_reply_t_handler (vl_api_memclnt_create_reply_t * mp) unserialize_open_data (sm, tblv, vec_len (tblv)); unserialize_integer (sm, &nmsgs, sizeof (u32)); + VL_API_VEC_UNPOISON (tblv); + for (i = 0; i < nmsgs; i++) { msg_index = unserialize_likely_small_unsigned_integer (sm); @@ -168,6 +177,9 @@ vl_client_connect (const char *name, int ctx_quota, int input_queue_size) return -1; } + CLIB_MEM_UNPOISON (shmem_hdr, sizeof (*shmem_hdr)); + VL_MSG_API_SVM_QUEUE_UNPOISON (shmem_hdr->vl_input_queue); + pthread_mutex_lock (&svm->mutex); oldheap = svm_push_data_heap (svm); vl_input_queue = svm_queue_alloc_and_init (input_queue_size, sizeof (uword), @@ -211,6 +223,7 @@ vl_client_connect (const char *name, int ctx_quota, int input_queue_size) return -1; read_one_msg: + VL_MSG_API_UNPOISON (rp); if (ntohs (rp->_vl_msg_id) != VL_API_MEMCLNT_CREATE_REPLY) { clib_warning ("unexpected reply: id %d", ntohs (rp->_vl_msg_id)); @@ -295,6 +308,8 @@ vl_client_disconnect (void) if (svm_queue_sub (vl_input_queue, (u8 *) & rp, SVM_Q_NOWAIT, 0) < 0) continue; + VL_MSG_API_UNPOISON (rp); + /* drain the queue */ if (ntohs (rp->_vl_msg_id) != VL_API_MEMCLNT_DELETE_REPLY) { |