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 2AEE1A04B5 for ; Tue, 3 Dec 2019 19:29:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2178537AF; Tue, 3 Dec 2019 19:29:26 +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 AD0881BFCD for ; Tue, 3 Dec 2019 19:29:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397764; 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=QF5u2kwdPCxABBihC9i0ZOCbn9QPvL703gVhKmeo6j4=; b=DDwzfO8m6WEZNaY/XxxBuKiPux/1jQEx9LG+tMNaSox66CtrRaStzvZ+Qtc6x52s2mFQlf aXh1AOtnx9/c8yAEPFnkjrUYijldktUeEdqf0KWqO+nQ4B1gpvxL+Qa7nGnVrYJMEz6Rhy fH8ALf1NoGURguJ3IbLs53lDKBjtCSg= 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-312-er2MqE9XNp2GPtxjzGNVYQ-1; Tue, 03 Dec 2019 13:29:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADD231883521; Tue, 3 Dec 2019 18:29:21 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80FCB5C240; Tue, 3 Dec 2019 18:29:20 +0000 (UTC) From: Kevin Traynor To: Kalesh AP Cc: Somnath Kotur , Ajit Khaparde , dpdk stable Date: Tue, 3 Dec 2019 18:27:13 +0000 Message-Id: <20191203182714.17297-64-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: er2MqE9XNp2GPtxjzGNVYQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bnxt: fix dereference before null 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/10/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/b661bfd5a01e3f28e6= 0faa825e6ea5b599a3c980 Thanks. Kevin. --- >From b661bfd5a01e3f28e60faa825e6ea5b599a3c980 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 9 Oct 2019 14:16:17 +0530 Subject: [PATCH] net/bnxt: fix dereference before null check [ upstream commit 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 ] This patch fixes potential null pointer access in bnxt_alloc_ag_data(). Fix to return an error if null check is true. Fixes: daef48efe5e5 ("net/bnxt: support set MTU") Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_rxr.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 88ea94214..918a7ae87 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -62,15 +62,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_que= ue *rxq, =09struct rte_mbuf *mbuf; =20 -=09mbuf =3D __bnxt_alloc_rx_data(rxq->mb_pool); -=09if (!mbuf) { -=09=09rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail); -=09=09return -ENOMEM; -=09} - -=09if (rxbd =3D=3D NULL) +=09if (rxbd =3D=3D NULL) { =09=09PMD_DRV_LOG(ERR, "Jumbo Frame. rxbd is NULL\n"); -=09if (rx_buf =3D=3D NULL) +=09=09return -EINVAL; +=09} + +=09if (rx_buf =3D=3D NULL) { =09=09PMD_DRV_LOG(ERR, "Jumbo Frame. rx_buf is NULL\n"); +=09=09return -EINVAL; +=09} =20 +=09mbuf =3D __bnxt_alloc_rx_data(rxq->mb_pool); +=09if (!mbuf) { +=09=09rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail); +=09=09return -ENOMEM; +=09} =20 =09rx_buf->mbuf =3D mbuf; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:55.445418677 +0000 +++ 0064-net-bnxt-fix-dereference-before-null-check.patch=092019-12-03 17:2= 9:51.798748954 +0000 @@ -1 +1 @@ -From 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 Mon Sep 17 00:00:00 2001 +From b661bfd5a01e3f28e60faa825e6ea5b599a3c980 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5e592e8d4091da4ad1faadd9c3719bd4c245cca4 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index f0f9b020b..03dae571b 100644 +index 88ea94214..918a7ae87 100644 @@ -23 +24 @@ -@@ -64,15 +64,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_qu= eue *rxq, +@@ -62,15 +62,19 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_qu= eue *rxq,