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 CE87C45DB9 for ; Wed, 27 Nov 2024 18:20:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3FA9402E4; Wed, 27 Nov 2024 18:20:13 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1945F4064C for ; Wed, 27 Nov 2024 18:20:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732728011; 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=5Dt6aU7AVrGmn++MkHMV+icaMV59i+7PomaJf3r3vSE=; b=OLZtAuDXKrBo5a6Hq0vz+zQKsSg8tIuVqZkRjrXzcR4S4YifnWra0+7J2OwE7OLDj2zePq +76hDfkylw6+3J4eOeEfdbLH5HsAb1hPnkahLZEf1uQUGTokt19PEpZTWKnkqbY0qgPUxb 5hzR2r3eRZgErXNeBS/4HHmlrl3xyns= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-EYy2HP3PN7irGU6jXUXTEw-1; Wed, 27 Nov 2024 12:20:10 -0500 X-MC-Unique: EYy2HP3PN7irGU6jXUXTEw-1 X-Mimecast-MFC-AGG-ID: EYy2HP3PN7irGU6jXUXTEw Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6456119560BE; Wed, 27 Nov 2024 17:20:09 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.52]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B3F5D30001A2; Wed, 27 Nov 2024 17:20:07 +0000 (UTC) From: Kevin Traynor To: Thomas Monjalon Cc: David Marchand , dpdk stable Subject: patch 'net/nfb: fix use after free' has been queued to stable release 21.11.9 Date: Wed, 27 Nov 2024 17:17:24 +0000 Message-ID: <20241127171916.690404-17-ktraynor@redhat.com> In-Reply-To: <20241127171916.690404-1-ktraynor@redhat.com> References: <20241127171916.690404-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JMZcHqiZlFjl4IPc4fPnNG7mqWOxYfbzy1uCSvC6lAY_1732728009 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.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 12/02/24. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/61697c515ccbf60c11ca2ea65f0b980a2105fcaf Thanks. Kevin --- >From 61697c515ccbf60c11ca2ea65f0b980a2105fcaf Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Thu, 10 Oct 2024 19:11:07 +0200 Subject: [PATCH] net/nfb: fix use after free [ upstream commit 76da9834ebb6e43e005bd5895ff4568d0e7be78f ] With the annotations added to the allocation functions in commit 80da7efbb4c4 ("eal: annotate allocation functions"), more issues are detected at compilation time: nfb_rx.c:133:28: error: pointer 'rxq' used after 'rte_free' It is fixed by moving the assignment before freeing the parent pointer. Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver") Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand --- drivers/net/nfb/nfb_rx.c | 2 +- drivers/net/nfb/nfb_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c index f76e2ba646..f260baed36 100644 --- a/drivers/net/nfb/nfb_rx.c +++ b/drivers/net/nfb/nfb_rx.c @@ -183,6 +183,6 @@ nfb_eth_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) if (rxq->queue != NULL) { ndp_close_rx_queue(rxq->queue); - rte_free(rxq); rxq->queue = NULL; + rte_free(rxq); } } diff --git a/drivers/net/nfb/nfb_tx.c b/drivers/net/nfb/nfb_tx.c index d49fc324e7..5c38d69934 100644 --- a/drivers/net/nfb/nfb_tx.c +++ b/drivers/net/nfb/nfb_tx.c @@ -109,6 +109,6 @@ nfb_eth_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid) if (txq->queue != NULL) { ndp_close_tx_queue(txq->queue); - rte_free(txq); txq->queue = NULL; + rte_free(txq); } } -- 2.47.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-27 17:17:38.858762671 +0000 +++ 0017-net-nfb-fix-use-after-free.patch 2024-11-27 17:17:38.172269098 +0000 @@ -1 +1 @@ -From 76da9834ebb6e43e005bd5895ff4568d0e7be78f Mon Sep 17 00:00:00 2001 +From 61697c515ccbf60c11ca2ea65f0b980a2105fcaf Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 76da9834ebb6e43e005bd5895ff4568d0e7be78f ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index f72afafe8f..462bc3b50d 100644 +index f76e2ba646..f260baed36 100644 @@ -28 +29 @@ -@@ -130,6 +130,6 @@ nfb_eth_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) +@@ -183,6 +183,6 @@ nfb_eth_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) @@ -37 +38 @@ -index a1318a4205..cf99268c43 100644 +index d49fc324e7..5c38d69934 100644