From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 0BE395F16 for ; Mon, 30 Jul 2018 18:22:22 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAra-00009D-Ub; Mon, 30 Jul 2018 16:17:38 +0000 From: Christian Ehrhardt To: Kiran Kumar Cc: Andrew Rybchenko , dpdk stable Date: Mon, 30 Jul 2018 18:12:43 +0200 Message-Id: <20180730161342.16566-118-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'ethdev: check queue stats mapping input arguments' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:22:22 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From b58a253ff1f08b5297c29c2e3d1af29974e6b16f Mon Sep 17 00:00:00 2001 From: Kiran Kumar Date: Wed, 11 Jul 2018 14:11:59 +0530 Subject: [PATCH] ethdev: check queue stats mapping input arguments [ upstream commit de9c75a5485832104d2a0c246544ba3a511802b4 ] With current implementation, we are not checking for queue_id range and stat_idx range in stats mapping function. This patch will add check for queue_id and stat_idx range. Fixes: 5de201df892 ("ethdev: add stats per queue") Signed-off-by: Kiran Kumar Acked-by: Andrew Rybchenko --- lib/librte_ethdev/rte_ethdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index cd4bfd3c6..5d1471b99 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2456,6 +2456,16 @@ set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->queue_stats_mapping_set, -ENOTSUP); + + if (is_rx && (queue_id >= dev->data->nb_rx_queues)) + return -EINVAL; + + if (!is_rx && (queue_id >= dev->data->nb_tx_queues)) + return -EINVAL; + + if (stat_idx >= RTE_ETHDEV_QUEUE_STAT_CNTRS) + return -EINVAL; + return (*dev->dev_ops->queue_stats_mapping_set) (dev, queue_id, stat_idx, is_rx); } -- 2.17.1