From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97EE6A0A0C for ; Mon, 17 May 2021 18:14:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EA81410F1; Mon, 17 May 2021 18:14:19 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id A8E16410E0 for ; Mon, 17 May 2021 18:14:17 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifsl-00082m-Bx; Mon, 17 May 2021 16:14:15 +0000 From: Christian Ehrhardt To: Chengchang Tang Cc: Min Hu , Ferruh Yigit , dpdk stable Date: Mon, 17 May 2021 18:08:40 +0200 Message-Id: <20210517161039.3132619-91-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'ethdev: validate input in EEPROM info' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.9 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/19/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/73a2b50eb55212a003ab3c3d912c8d0f751c8dbf Thanks. Christian Ehrhardt --- >From 73a2b50eb55212a003ab3c3d912c8d0f751c8dbf Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Fri, 2 Apr 2021 10:58:50 +0800 Subject: [PATCH] ethdev: validate input in EEPROM info [ 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 Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- 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 607608a65f..df4bb9c5bc 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -4899,6 +4899,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); @@ -4911,6 +4913,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 73b6d10909..d42226daa3 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -3853,6 +3853,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. */ @@ -3883,6 +3884,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.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:33.072047759 +0200 +++ 0091-ethdev-validate-input-in-EEPROM-info.patch 2021-05-17 17:40:29.295810453 +0200 @@ -1 +1 @@ -From 18239da4ac2155582d91d4ccb8ed8b2193193534 Mon Sep 17 00:00:00 2001 +From 73a2b50eb55212a003ab3c3d912c8d0f751c8dbf Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 18239da4ac2155582d91d4ccb8ed8b2193193534 ] + @@ -9 +10,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 3fe200d508..6b5cfd696d 100644 +index 607608a65f..df4bb9c5bc 100644 @@ -23 +24 @@ -@@ -5312,6 +5312,8 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) +@@ -4899,6 +4899,8 @@ rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) @@ -32 +33 @@ -@@ -5324,6 +5326,8 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) +@@ -4911,6 +4913,8 @@ rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) @@ -42 +43 @@ -index 1ad7cda27d..3b773b6dd0 100644 +index 73b6d10909..d42226daa3 100644 @@ -45,2 +46 @@ -@@ -4435,6 +4435,7 @@ int rte_eth_dev_get_eeprom_length(uint16_t port_id); - * @return +@@ -3853,6 +3853,7 @@ int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, @@ -49 +48,0 @@ -+ * - (-EINVAL) if bad parameter. @@ -50,0 +50 @@ ++ * - (-EINVAL) if bad parameter. @@ -53 +53,3 @@ -@@ -4453,6 +4454,7 @@ int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); + */ +@@ -3883,6 +3884,7 @@ int rte_eth_dev_get_eeprom_length(uint16_t port_id); + * @return @@ -56 +57,0 @@ - * - (-ENODEV) if *port_id* invalid. @@ -57,0 +59 @@ + * - (-ENODEV) if *port_id* invalid. @@ -60 +61,0 @@ - */