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 5286348B69 for ; Fri, 21 Nov 2025 12:24:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C3A64026F; Fri, 21 Nov 2025 12:24:46 +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 EE76D4026F for ; Fri, 21 Nov 2025 12:24:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763724284; 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=GeU4zxI74iV8ZgJiwxn6ruRXRZQ5IOlRBDktuQyNEhQ=; b=bYXcp5O1+uYhV0eKEqLG4AjF3VkDcXI4ntK/aEXiuUUT8B0iJRzDl++d2uVSz4g/O4eGvm t2+tt1P4218eYnFCdvth/Ik30DSzr75fHAo9qEvLreXU1asdH/my51za0tsjpVlVd5bx7h FwsSivQE0NRBYyht2ESPC8k1ZMpi+3Y= Received: from mx-prod-mc-01.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-195-kSr0LZNuMb2qc8P7RnTVmQ-1; Fri, 21 Nov 2025 06:24:41 -0500 X-MC-Unique: kSr0LZNuMb2qc8P7RnTVmQ-1 X-Mimecast-MFC-AGG-ID: kSr0LZNuMb2qc8P7RnTVmQ_1763724277 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D0BA1956096; Fri, 21 Nov 2025 11:24:37 +0000 (UTC) Received: from rh.redhat.com (unknown [10.42.28.165]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E7EB730044E9; Fri, 21 Nov 2025 11:24:35 +0000 (UTC) From: Kevin Traynor To: Nupur Uttarwar Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5/hws: fix buddy memory allocation' has been queued to stable release 24.11.4 Date: Fri, 21 Nov 2025 11:21:13 +0000 Message-ID: <20251121112128.485623-89-ktraynor@redhat.com> In-Reply-To: <20251121112128.485623-1-ktraynor@redhat.com> References: <20251121112128.485623-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: __Ws88b0hzLA47Jxk6SibMveBo-kkrJfbuYfRh6gCaw_1763724277 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 24.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/26/25. 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/c9894fd65cd95d579cc0c6f98910d49644149b8a Thanks. Kevin --- >From c9894fd65cd95d579cc0c6f98910d49644149b8a Mon Sep 17 00:00:00 2001 From: Nupur Uttarwar Date: Wed, 12 Nov 2025 09:47:39 +0200 Subject: [PATCH] net/mlx5/hws: fix buddy memory allocation [ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ] `buddy` was erroroneously declared as static. When multiple threads call this routine, they set the same static variable corrupting pool data and can cause potential double free when releasing resources. Fixes: b4dd7bcb0dcb ("net/mlx5/hws: add pool and buddy") Signed-off-by: Nupur Uttarwar Acked-by: Dariusz Sosnowski --- .mailmap | 1 + drivers/net/mlx5/hws/mlx5dr_buddy.c | 1 + drivers/net/mlx5/hws/mlx5dr_pool.c | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 228bd1af42..723b168e04 100644 --- a/.mailmap +++ b/.mailmap @@ -1135,4 +1135,5 @@ Nobuhiro Miki Norbert Ciosek Norbert Zulinski +Nupur Uttarwar Odi Assli Ofer Dagan diff --git a/drivers/net/mlx5/hws/mlx5dr_buddy.c b/drivers/net/mlx5/hws/mlx5dr_buddy.c index 394ca71217..abfbdf1be5 100644 --- a/drivers/net/mlx5/hws/mlx5dr_buddy.c +++ b/drivers/net/mlx5/hws/mlx5dr_buddy.c @@ -148,4 +148,5 @@ void mlx5dr_buddy_cleanup(struct mlx5dr_buddy_mem *buddy) simple_free(buddy->num_free); simple_free(buddy->bits); + simple_free(buddy); } diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.c b/drivers/net/mlx5/hws/mlx5dr_pool.c index b7b532c7cf..a99182e0ca 100644 --- a/drivers/net/mlx5/hws/mlx5dr_pool.c +++ b/drivers/net/mlx5/hws/mlx5dr_pool.c @@ -168,5 +168,5 @@ mlx5dr_pool_buddy_get_next_buddy(struct mlx5dr_pool *pool, int idx, uint32_t order, bool *is_new_buddy) { - static struct mlx5dr_buddy_mem *buddy; + struct mlx5dr_buddy_mem *buddy; uint32_t new_buddy_size; @@ -272,5 +272,4 @@ static void mlx5dr_pool_buddy_db_uninit(struct mlx5dr_pool *pool) if (buddy) { mlx5dr_buddy_cleanup(buddy); - simple_free(buddy); pool->db.buddy_manager->buddies[i] = NULL; } -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-21 11:05:12.319143856 +0000 +++ 0089-net-mlx5-hws-fix-buddy-memory-allocation.patch 2025-11-21 11:05:09.593201724 +0000 @@ -1 +1 @@ -From 8d1fe10768d2749d00ceb7124866c61d31164380 Mon Sep 17 00:00:00 2001 +From c9894fd65cd95d579cc0c6f98910d49644149b8a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ] + @@ -22 +24 @@ -index f9c5622e5d..efc66fd48c 100644 +index 228bd1af42..723b168e04 100644 @@ -25 +27 @@ -@@ -1181,4 +1181,5 @@ Nobuhiro Miki +@@ -1135,4 +1135,5 @@ Nobuhiro Miki @@ -42 +44 @@ -index 8e3718ac42..e383027d3e 100644 +index b7b532c7cf..a99182e0ca 100644