[dpdk-stable] patch 'ethdev: validate input in EEPROM info' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 18:01:42 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/a096b11ef5d59f17380a8b97a4d6cfe92d114356

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From a096b11ef5d59f17380a8b97a4d6cfe92d114356 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang at huawei.com>
Date: Fri, 2 Apr 2021 10:58:50 +0800
Subject: [PATCH] ethdev: validate input in EEPROM info
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 18239da4ac2155582d91d4ccb8ed8b2193193534 ]

This patch adds validity check of input pointer in EEPROM dump API.

Fixes: 7a3f27cbf59b ("ethdev: add access to specific device info")

Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_ethdev/rte_ethdev.c | 4 ++++
 lib/librte_ethdev/rte_ethdev.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 3e3a5bd8cf..8a3c999010 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -5284,6 +5284,8 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
 	struct rte_eth_dev *dev;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	if (info == NULL)
+		return -EINVAL;
 
 	dev = &rte_eth_devices[port_id];
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_eeprom, -ENOTSUP);
@@ -5296,6 +5298,8 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
 	struct rte_eth_dev *dev;
 
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	if (info == NULL)
+		return -EINVAL;
 
 	dev = &rte_eth_devices[port_id];
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_eeprom, -ENOTSUP);
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 1cd1ef9d54..3ec7e9a6b3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4348,6 +4348,7 @@ int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
  *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
  *   - (-EIO) if device is removed.
  *   - others depends on the specific operations implementation.
  */
@@ -4378,6 +4379,7 @@ int rte_eth_dev_get_eeprom_length(uint16_t port_id);
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support.
+ *   - (-EINVAL) if bad parameter.
  *   - (-ENODEV) if *port_id* invalid.
  *   - (-EIO) if device is removed.
  *   - others depends on the specific operations implementation.
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:30.573855000 +0800
+++ 0154-ethdev-validate-input-in-EEPROM-info.patch	2021-05-10 23:59:26.590000000 +0800
@@ -1 +1 @@
-From 18239da4ac2155582d91d4ccb8ed8b2193193534 Mon Sep 17 00:00:00 2001
+From a096b11ef5d59f17380a8b97a4d6cfe92d114356 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 18239da4ac2155582d91d4ccb8ed8b2193193534 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 3fe200d508..6b5cfd696d 100644
+index 3e3a5bd8cf..8a3c999010 100644
@@ -23 +25 @@
-@@ -5312,6 +5312,8 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
+@@ -5284,6 +5284,8 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
@@ -32 +34 @@
-@@ -5324,6 +5326,8 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
+@@ -5296,6 +5298,8 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
@@ -42 +44 @@
-index 1ad7cda27d..3b773b6dd0 100644
+index 1cd1ef9d54..3ec7e9a6b3 100644
@@ -45,2 +47 @@
-@@ -4435,6 +4435,7 @@ int rte_eth_dev_get_eeprom_length(uint16_t port_id);
-  * @return
+@@ -4348,6 +4348,7 @@ int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
@@ -49 +49,0 @@
-+ *   - (-EINVAL) if bad parameter.
@@ -50,0 +51 @@
++ *   - (-EINVAL) if bad parameter.
@@ -53 +54,3 @@
-@@ -4453,6 +4454,7 @@ int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
+  */
+@@ -4378,6 +4379,7 @@ int rte_eth_dev_get_eeprom_length(uint16_t port_id);
+  * @return
@@ -56 +58,0 @@
-  *   - (-ENODEV) if *port_id* invalid.
@@ -57,0 +60 @@
+  *   - (-ENODEV) if *port_id* invalid.
@@ -60 +62,0 @@
-  */


More information about the stable mailing list