From: Andrew Yourtchenko Date: Tue, 24 Jan 2017 14:47:27 +0000 (+0100) Subject: ping: fix double-free crash under VMWare hypervisor X-Git-Tag: v17.04-rc1~334 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=f69ecfe09db52c672ccbe47e714bc9c9a70d5539;p=vpp.git ping: fix double-free crash under VMWare hypervisor bi0 retrieval from the ping reply events vector was incorrectly done always from the first element. For TBD reason the sending of the ping requests under VMWare was batched, as a result the replies arrive close enough to make the events arrive as an array, which exposed this bug. KVM never exhibited this behavior, which explains not seeing this issue there. Change-Id: I485d6f983571e25baa9407c21ef604937586d8bd Signed-off-by: Andrew Yourtchenko --- diff --git a/src/vnet/ip/ping.c b/src/vnet/ip/ping.c index 68dbe759ebc..88882629426 100644 --- a/src/vnet/ip/ping.c +++ b/src/vnet/ip/ping.c @@ -601,7 +601,7 @@ run_ping_ip46_address (vlib_main_t * vm, u32 table_id, ip4_address_t * pa4, int i; for (i = 0; i < vec_len (event_data); i++) { - u32 bi0 = event_data[0]; + u32 bi0 = event_data[i]; print_ip6_icmp_reply (vm, bi0); n_replies++; if (0 != bi0) @@ -616,7 +616,7 @@ run_ping_ip46_address (vlib_main_t * vm, u32 table_id, ip4_address_t * pa4, int i; for (i = 0; i < vec_len (event_data); i++) { - u32 bi0 = event_data[0]; + u32 bi0 = event_data[i]; print_ip4_icmp_reply (vm, bi0); n_replies++; if (0 != bi0)