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 5F35E48A44 for ; Fri, 31 Oct 2025 15:36:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56EEB40669; Fri, 31 Oct 2025 15:36:38 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id AA2EA40150 for ; Fri, 31 Oct 2025 15:36:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921396; 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=wDUqrHb4DIdYLP8sN6yoB5Q8c4pd1aGjwn7tvLA5MZ4=; b=isGVFmFNXhupcU293eV2XTW3aQFpC8F4B44FWp1zmoNBxPOlu0fqWke7yPzMFQlsAUOrJ3 Bkqxa6tQfdR03c0I5tXRd9satbUYAUHGfvQcZUJXgZdhCJJ2qWicsPuZrcyGYxXVOoTtz8 +kbxUPX3WSpnJPHCra58P7qScp8xfYU= Received: from mx-prod-mc-03.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-360-n7W4NQU4N6OzxoA3cTeAXg-1; Fri, 31 Oct 2025 10:36:33 -0400 X-MC-Unique: n7W4NQU4N6OzxoA3cTeAXg-1 X-Mimecast-MFC-AGG-ID: n7W4NQU4N6OzxoA3cTeAXg_1761921391 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 013E01956068; Fri, 31 Oct 2025 14:36:31 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6EDAF18004D4; Fri, 31 Oct 2025 14:36:29 +0000 (UTC) From: Kevin Traynor To: Maayan Kashani Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix index-based flow rules' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:32:33 +0000 Message-ID: <20251031143421.324432-31-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _0dPbmWciAIOjxAAfWfoAUQmu0YB3T8erKCw0RPBhy4_1761921391 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/05/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/1d6b9ec03f78f6733899ce4f65f2db096750f44b Thanks. Kevin --- >From 1d6b9ec03f78f6733899ce4f65f2db096750f44b Mon Sep 17 00:00:00 2001 From: Maayan Kashani Date: Wed, 30 Jul 2025 10:16:59 +0300 Subject: [PATCH] net/mlx5: fix index-based flow rules [ upstream commit 4a35eb531b7542c4f86b98bb04b46f17081b537d ] During asynchronous flow creation by index, the items array was initialized with only one element, but the table metadata did not update the item count accordingly. This mismatch led to an out-of-bounds memcpy operation, as the code attempted to copy more elements than were actually allocated. To resolve this, since item matching is disregarded when inserting a rule by index (the rule is triggered when a packet reaches the specified index), the fix is to skip preparing the items array in this case. Instead, the items array should only contain a single element, RTE_FLOW_ITEM_TYPE_END, which indicates no match pattern is needed. This prevents unsafe memory operations and aligns the array size with its intended usage. Fixes: 36c379c82e82 ("net/mlx5: add flow rule insertion by index with pattern") Signed-off-by: Maayan Kashani Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 586500753a..56d9504cb3 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -3935,8 +3935,12 @@ flow_hw_async_flow_create_generic(struct rte_eth_dev *dev, rule_acts, queue, &sub_error)) goto error; - rule_items = flow_hw_get_rule_items(dev, table, items, - pattern_template_index, &priv->hw_q[queue].pp); - if (!rule_items) - goto error; + if (insertion_type == RTE_FLOW_TABLE_INSERTION_TYPE_INDEX) { + rule_items = items; + } else { + rule_items = flow_hw_get_rule_items(dev, table, items, + pattern_template_index, &priv->hw_q[queue].pp); + if (!rule_items) + goto error; + } if (likely(!rte_flow_template_table_resizable(dev->data->port_id, &table->cfg.attr))) { ret = mlx5dr_rule_create(table->matcher_info[0].matcher, -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:53.212850054 +0000 +++ 0031-net-mlx5-fix-index-based-flow-rules.patch 2025-10-31 13:53:52.066523462 +0000 @@ -1 +1 @@ -From 4a35eb531b7542c4f86b98bb04b46f17081b537d Mon Sep 17 00:00:00 2001 +From 1d6b9ec03f78f6733899ce4f65f2db096750f44b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 4a35eb531b7542c4f86b98bb04b46f17081b537d ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index 6dc16f80d3..016370f68b 100644 +index 586500753a..56d9504cb3 100644 @@ -34 +35 @@ -@@ -3983,8 +3983,12 @@ flow_hw_async_flow_create_generic(struct rte_eth_dev *dev, +@@ -3935,8 +3935,12 @@ flow_hw_async_flow_create_generic(struct rte_eth_dev *dev,