[PATCH] net/mlx5: fix stack-buffer-overflow in indexed based rules

Raslan Darawsheh rasland at nvidia.com
Mon Aug 18 08:31:01 CEST 2025


Hi,


On 30/07/2025 10:16 AM, Maayan Kashani wrote:
> 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")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh



More information about the dev mailing list