vmbus_map_addr is used as the next start virtual address for mapping ring
buffer. However it's updated based on ring_buf, which is a pointer to an
address on the stack. The next ring buffer may be mapped to an unexpected
address.
Fix this by calculating vmbus_map_addr based on returned virtual address.
Fixes:
3f9277031a2e ("bus/vmbus: fix check for mmap failure")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
*ring_size = file_size / 2;
*ring_buf = mapaddr;
- vmbus_map_addr = RTE_PTR_ADD(ring_buf, file_size);
+ vmbus_map_addr = RTE_PTR_ADD(mapaddr, file_size);
return 0;
}