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 48E1EA0A02 for ; Mon, 17 May 2021 18:17:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4238E410F7; Mon, 17 May 2021 18:17:02 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 51590410EA for ; Mon, 17 May 2021 18:17:00 +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 1lifvO-0008Qa-8A; Mon, 17 May 2021 16:16:58 +0000 From: Christian Ehrhardt To: Chengchang Tang Cc: Min Hu , Ferruh Yigit , dpdk stable Date: Mon, 17 May 2021 18:09:53 +0200 Message-Id: <20210517161039.3132619-164-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 'net/bonding: fix socket ID check' 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/6157e7a3db25bd117be65d0eda209a6b6ef7bb42 Thanks. Christian Ehrhardt --- >From 6157e7a3db25bd117be65d0eda209a6b6ef7bb42 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Tue, 27 Apr 2021 19:39:41 +0800 Subject: [PATCH] net/bonding: fix socket ID check [ upstream commit f294e04851fda95ef7842319865d53d2df0da0d1 ] The socket ID entered by user is cast to an unsigned integer. However, the value may be an illegal negative value, which may cause some problems. In this case, an error should be returned. In addition, the socket ID may be an invalid positive number, which is also processed in this patch. Fixes: 2efb58cbab6e ("bond: new link bonding library") Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- drivers/net/bonding/rte_eth_bond_args.c | 8 ++++---- drivers/net/bonding/rte_eth_bond_pmd.c | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 8c5f90dc63..764b1b8c8e 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -200,20 +200,20 @@ int bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused, const char *value, void *extra_args) { - int socket_id; + long socket_id; char *endptr; if (value == NULL || extra_args == NULL) return -1; errno = 0; - socket_id = (uint8_t)strtol(value, &endptr, 10); + socket_id = strtol(value, &endptr, 10); if (*endptr != 0 || errno != 0) return -1; /* validate socket id value */ - if (socket_id >= 0) { - *(uint8_t *)extra_args = (uint8_t)socket_id; + if (socket_id >= 0 && socket_id < RTE_MAX_NUMA_NODES) { + *(int *)extra_args = (int)socket_id; return 0; } return -1; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 68cf5fef69..56e18bad9e 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3297,8 +3297,9 @@ bond_probe(struct rte_vdev_device *dev) const char *name; struct bond_dev_private *internals; struct rte_kvargs *kvlist; - uint8_t bonding_mode, socket_id/*, agg_mode*/; - int arg_count, port_id; + uint8_t bonding_mode; + int arg_count, port_id; + int socket_id; uint8_t agg_mode; struct rte_eth_dev *eth_dev; -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:35.830974264 +0200 +++ 0164-net-bonding-fix-socket-ID-check.patch 2021-05-17 17:40:29.475811870 +0200 @@ -1 +1 @@ -From f294e04851fda95ef7842319865d53d2df0da0d1 Mon Sep 17 00:00:00 2001 +From 6157e7a3db25bd117be65d0eda209a6b6ef7bb42 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f294e04851fda95ef7842319865d53d2df0da0d1 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -54 +55 @@ -index 25b1f771a1..6ba09c4d9e 100644 +index 68cf5fef69..56e18bad9e 100644 @@ -57 +58 @@ -@@ -3333,8 +3333,9 @@ bond_probe(struct rte_vdev_device *dev) +@@ -3297,8 +3297,9 @@ bond_probe(struct rte_vdev_device *dev)