[PATCH] net/mlx5: fix ASan issue in RSS flow creation

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


Hi,


On 05/08/2025 4:20 PM, Maayan Kashani wrote:
> This patch addresses AddressSanitizer (ASan) stack-use-after-scope
> issues occurring during RSS flow creation in the MLX5 driver.
> The root cause stemmed from the use of compound literals to
> initialize flow action configurations, which could result in
> pointers to temporary stack memory being retained in flow structures.
> When these pointers were later accessed during flow conversion,
> the underlying stack memory was no longer valid,
> leading to ASAN-detected errors.
> 
> Modifications:
> In mlx5_hw_rss_ptype_create_base_flow(),
> the struct rte_flow_action_jump is now constructed
> at the start of the function, rather than within the do statement.
> This ensures a persistent stack allocation for the structure,
> preventing use-after-scope situations.
> 
> This change eliminates the following ASan errors:
> stack-use-after-scope reported in rte_flow_conv_copy
> 
> Fixes: ae67e3c43dd5 ("net/mlx5: support RSS expansion in non-template HWS setup")
> 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