[dpdk-stable] patch 'ethdev: avoid undefined behaviour on configuration copy' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Wed Dec 11 22:26:32 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/17/19. 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.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/b451f20f6f56c90872d9cd4a7cd6572c4ecb35b0

Thanks.

Kevin.

---
>From b451f20f6f56c90872d9cd4a7cd6572c4ecb35b0 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko at solarflare.com>
Date: Tue, 19 Nov 2019 08:22:50 +0000
Subject: [PATCH] ethdev: avoid undefined behaviour on configuration copy

[ upstream commit 6e18704b7e19855a0744cf4b291f1d1fe874d710 ]

memcpy() source and destination areas must not overlap and equal
pointers is the case which is really met, so handle it.

Fixes: 68b931bff287 ("ethdev: eliminate interim variable")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_ethdev/rte_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index b3fce9b08..16e6a5d38 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1115,5 +1115,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	 * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get
 	 */
-	memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf));
+	if (dev_conf != &dev->data->dev_conf)
+		memcpy(&dev->data->dev_conf, dev_conf,
+		       sizeof(dev->data->dev_conf));
 
 	rte_eth_dev_info_get(port_id, &dev_info);
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-11 21:24:15.876874697 +0000
+++ 0040-ethdev-avoid-undefined-behaviour-on-configuration-co.patch	2019-12-11 21:24:12.681650928 +0000
@@ -1 +1 @@
-From 6e18704b7e19855a0744cf4b291f1d1fe874d710 Mon Sep 17 00:00:00 2001
+From b451f20f6f56c90872d9cd4a7cd6572c4ecb35b0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6e18704b7e19855a0744cf4b291f1d1fe874d710 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 8f48e8d65..8d2ce31a8 100644
+index b3fce9b08..16e6a5d38 100644
@@ -22 +23 @@
-@@ -1246,5 +1246,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
+@@ -1115,5 +1115,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
@@ -30 +31 @@
- 	ret = rte_eth_dev_info_get(port_id, &dev_info);
+ 	rte_eth_dev_info_get(port_id, &dev_info);



More information about the stable mailing list