bus/vmbus: fix ring buffer mapping
authorLong Li <longli@microsoft.com>
Fri, 12 Jun 2020 00:48:25 +0000 (17:48 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 24 Jun 2020 23:04:17 +0000 (01:04 +0200)
commit1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f
tree45a2b480f500555270de1bd38b18e05fbc178602
parent78621061f7f8d20544f81b391a62acb735275add
bus/vmbus: fix ring buffer mapping

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>
drivers/bus/vmbus/linux/vmbus_uio.c