From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3BCB8A04F0 for ; Tue, 10 Dec 2019 16:02:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2EA0A1BF70; Tue, 10 Dec 2019 16:02:06 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id B5FE31BF6E for ; Tue, 10 Dec 2019 16:02:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575990124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bQWMVjr7A0jJ0toSJZLL+6WKElcVcsJnbW6LApn9/1Y=; b=XTtQB0ZviBwo0wbv21G+J3frn9WMq7wZhN7NL4LBFMwEWgd1annu485arQX4fg9UsZLMZI hYECTj6FXRVyWoEmMuULstUsXuCZDeyZThHks36ITdoGX+KIpOMsfLu7oMsmJFZLLpH1Wl ghJaafx4lJrnFTuh9HNCiY/HUK079UQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-244-l5Bgr0EDPteabPtwaq0otA-1; Tue, 10 Dec 2019 10:02:01 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B5A06802B82; Tue, 10 Dec 2019 15:02:00 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id A200E5DA75; Tue, 10 Dec 2019 15:01:59 +0000 (UTC) From: Kevin Traynor To: Junyu Jiang Cc: Chas Williams , dpdk stable Date: Tue, 10 Dec 2019 14:59:36 +0000 Message-Id: <20191210145937.32755-62-ktraynor@redhat.com> In-Reply-To: <20191210145937.32755-1-ktraynor@redhat.com> References: <20191210145937.32755-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: l5Bgr0EDPteabPtwaq0otA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bonding: fix port ID check' has been queued to LTS release 18.11.6 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.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 12/16/19. 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 rebasi= ng (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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/19e6ac59dd55bf040d= 7e6523d72a4ff826dc2b38 Thanks. Kevin. --- >From 19e6ac59dd55bf040d7e6523d72a4ff826dc2b38 Mon Sep 17 00:00:00 2001 From: Junyu Jiang Date: Tue, 29 Oct 2019 02:23:41 +0000 Subject: [PATCH] net/bonding: fix port ID check [ upstream commit 588ae95e79834495f78192fc6bb3ae14c152439f ] Port validation should be prior to getting device data to avoid segment fault. This patch fixed the segment fault caused by invalid port using. Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control= ") Signed-off-by: Junyu Jiang Acked-by: Chas Williams --- drivers/net/bonding/rte_eth_bond_8023ad.c | 36 +++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bondin= g/rte_eth_bond_8023ad.c index 5004898e7..def27c9f1 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1301,9 +1301,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_= id, =09struct mode8023ad_private *mode4; =20 -=09bond_dev =3D &rte_eth_devices[port_id]; -=09internals =3D bond_dev->data->dev_private; - =09if (valid_bonded_port_id(port_id) !=3D 0) =09=09return -EINVAL; + +=09bond_dev =3D &rte_eth_devices[port_id]; +=09internals =3D bond_dev->data->dev_private; + =09if (internals->mode !=3D 4) =09=09return -EINVAL; @@ -1322,9 +1323,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t p= ort_id) =09struct mode8023ad_private *mode4; =20 -=09bond_dev =3D &rte_eth_devices[port_id]; -=09internals =3D bond_dev->data->dev_private; - =09if (valid_bonded_port_id(port_id) !=3D 0) =09=09return -EINVAL; + +=09bond_dev =3D &rte_eth_devices[port_id]; +=09internals =3D bond_dev->data->dev_private; + =09if (internals->mode !=3D 4) =09=09return -EINVAL; @@ -1579,7 +1581,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t= port) { =09int retval =3D 0; -=09struct rte_eth_dev *dev =3D &rte_eth_devices[port]; -=09struct bond_dev_private *internals =3D (struct bond_dev_private *) -=09=09dev->data->dev_private; +=09struct rte_eth_dev *dev; +=09struct bond_dev_private *internals; + +=09if (valid_bonded_port_id(port) !=3D 0) +=09=09return -EINVAL; + +=09dev =3D &rte_eth_devices[port]; +=09internals =3D dev->data->dev_private; =20 =09if (check_for_bonded_ethdev(dev) !=3D 0) @@ -1603,7 +1610,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_= t port) { =09int retval =3D 0; -=09struct rte_eth_dev *dev =3D &rte_eth_devices[port]; -=09struct bond_dev_private *internals =3D (struct bond_dev_private *) -=09=09dev->data->dev_private; +=09struct rte_eth_dev *dev; +=09struct bond_dev_private *internals; + +=09if (valid_bonded_port_id(port) !=3D 0) +=09=09return -EINVAL; + +=09dev =3D &rte_eth_devices[port]; +=09internals =3D dev->data->dev_private; =20 =09if (check_for_bonded_ethdev(dev) !=3D 0) --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-10 14:49:43.151229791 +0000 +++ 0062-net-bonding-fix-port-ID-check.patch=092019-12-10 14:49:39.11045668= 6 +0000 @@ -1 +1 @@ -From 588ae95e79834495f78192fc6bb3ae14c152439f Mon Sep 17 00:00:00 2001 +From 19e6ac59dd55bf040d7e6523d72a4ff826dc2b38 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 588ae95e79834495f78192fc6bb3ae14c152439f ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index badcd109a..05b3004c4 100644 +index 5004898e7..def27c9f1 100644 @@ -24 +25 @@ -@@ -1388,9 +1388,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port= _id, +@@ -1301,9 +1301,10 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port= _id, @@ -38 +39 @@ -@@ -1409,9 +1410,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t = port_id) +@@ -1322,9 +1323,10 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t = port_id) @@ -52 +53 @@ -@@ -1666,7 +1668,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_= t port) +@@ -1579,7 +1581,12 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_= t port) @@ -68 +69 @@ -@@ -1690,7 +1697,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16= _t port) +@@ -1603,7 +1610,12 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16= _t port)