[dpdk-stable] patch 'net/af_xdp: use strlcpy instead of strncpy' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:45:31 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.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 10/30/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 7029c20146ae6714be78a59e514df26242a5d855 Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus at intel.com>
Date: Wed, 7 Oct 2020 09:20:50 +0000
Subject: [PATCH] net/af_xdp: use strlcpy instead of strncpy

[ upstream commit 6d3c595d3a4e856307b92d1a824b07b48da1cc3c ]

strncpy may leave the destination buffer not NULL terminated so use
strlcpy instead.

Coverity issue: 362975
Fixes: 339b88c6a91f ("net/af_xdp: support multi-queue")

Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index c5c906ff96..6fab9aab78 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -1116,7 +1116,7 @@ xdp_get_channels_info(const char *if_name, int *max_queues,
 
 	channels.cmd = ETHTOOL_GCHANNELS;
 	ifr.ifr_data = (void *)&channels;
-	strncpy(ifr.ifr_name, if_name, IFNAMSIZ);
+	strlcpy(ifr.ifr_name, if_name, IFNAMSIZ);
 	ret = ioctl(fd, SIOCETHTOOL, &ifr);
 	if (ret) {
 		if (errno == EOPNOTSUPP) {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:17.061987119 +0000
+++ 0172-net-af_xdp-use-strlcpy-instead-of-strncpy.patch	2020-10-28 10:35:11.780834087 +0000
@@ -1,14 +1,15 @@
-From 6d3c595d3a4e856307b92d1a824b07b48da1cc3c Mon Sep 17 00:00:00 2001
+From 7029c20146ae6714be78a59e514df26242a5d855 Mon Sep 17 00:00:00 2001
 From: Ciara Loftus <ciara.loftus at intel.com>
 Date: Wed, 7 Oct 2020 09:20:50 +0000
 Subject: [PATCH] net/af_xdp: use strlcpy instead of strncpy
 
+[ upstream commit 6d3c595d3a4e856307b92d1a824b07b48da1cc3c ]
+
 strncpy may leave the destination buffer not NULL terminated so use
 strlcpy instead.
 
 Coverity issue: 362975
 Fixes: 339b88c6a91f ("net/af_xdp: support multi-queue")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
 Acked-by: Bruce Richardson <bruce.richardson at intel.com>
@@ -18,10 +19,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
-index eaf2c9c873..ac00cbab8e 100644
+index c5c906ff96..6fab9aab78 100644
 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
 +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
-@@ -1362,7 +1362,7 @@ xdp_get_channels_info(const char *if_name, int *max_queues,
+@@ -1116,7 +1116,7 @@ xdp_get_channels_info(const char *if_name, int *max_queues,
  
  	channels.cmd = ETHTOOL_GCHANNELS;
  	ifr.ifr_data = (void *)&channels;


More information about the stable mailing list