From: Florin Coras Date: Thu, 16 Aug 2018 22:45:34 +0000 (-0700) Subject: vlibapi: validate private segment rotor prior to use X-Git-Tag: v18.10-rc1~425 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=ec54e11a8426f4104261da579b5b9ae6fbc506f4;p=vpp.git vlibapi: validate private segment rotor prior to use If the dead client scan removes the rotor position we're about to check next, we end up outside the private registration pool's bounds. Change-Id: If4e715593deeac4c06ae6b3fededc1965b042094 Signed-off-by: Florin Coras --- diff --git a/src/vlibmemory/vlib_api.c b/src/vlibmemory/vlib_api.c index 35a8686a04d..65fa34bcc63 100644 --- a/src/vlibmemory/vlib_api.c +++ b/src/vlibmemory/vlib_api.c @@ -387,9 +387,9 @@ vl_api_clnt_process (vlib_main_t * vm, vlib_node_runtime_t * node, */ if (PREDICT_FALSE (vec_len (am->vlib_private_rps))) { - vl_mem_api_handle_msg_private (vm, node, private_segment_rotor++); if (private_segment_rotor >= vec_len (am->vlib_private_rps)) private_segment_rotor = 0; + vl_mem_api_handle_msg_private (vm, node, private_segment_rotor++); } vlib_process_wait_for_event_or_clock (vm, sleep_time);