[dpdk-stable] patch 'bus/vmbus: fix ring buffer mapping' has been queued to stable release 19.11.4

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Jul 24 13:58:07 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/26/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 72dae964fdb23f613e384c4e0b811ab146b72fd1 Mon Sep 17 00:00:00 2001
From: Long Li <longli at microsoft.com>
Date: Thu, 11 Jun 2020 17:48:25 -0700
Subject: [PATCH] bus/vmbus: fix ring buffer mapping

[ upstream commit 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f ]

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")

Signed-off-by: Long Li <longli at microsoft.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/bus/vmbus/linux/vmbus_uio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c
index 5451bfd15..5dc0c47de 100644
--- a/drivers/bus/vmbus/linux/vmbus_uio.c
+++ b/drivers/bus/vmbus/linux/vmbus_uio.c
@@ -242,7 +242,7 @@ static int vmbus_uio_map_subchan(const struct rte_vmbus_device *dev,
 	*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;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-07-24 12:53:50.503055446 +0100
+++ 0049-bus-vmbus-fix-ring-buffer-mapping.patch	2020-07-24 12:53:48.271006162 +0100
@@ -1,8 +1,10 @@
-From 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f Mon Sep 17 00:00:00 2001
+From 72dae964fdb23f613e384c4e0b811ab146b72fd1 Mon Sep 17 00:00:00 2001
 From: Long Li <longli at microsoft.com>
 Date: Thu, 11 Jun 2020 17:48:25 -0700
 Subject: [PATCH] bus/vmbus: fix ring buffer mapping
 
+[ upstream commit 1aef0aef3615d8b8d9d82cbb2d42afc2ae2bce7f ]
+
 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
@@ -11,7 +13,6 @@
 Fix this by calculating vmbus_map_addr based on returned virtual address.
 
 Fixes: 3f9277031a2e ("bus/vmbus: fix check for mmap failure")
-Cc: stable at dpdk.org
 
 Signed-off-by: Long Li <longli at microsoft.com>
 Acked-by: Stephen Hemminger <stephen at networkplumber.org>


More information about the stable mailing list