patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5/hws: fix invalid memory access in decapl3
@ 2024-03-22 10:01 Gregory Etelson
  2024-03-24 22:21 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2024-03-22 10:01 UTC (permalink / raw)
  To: dev
  Cc: getelson, mkashani, rasland, valex, stable, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad,
	Erez Shitrit

From: Alex Vesker <valex@nvidia.com>

In case decapL3 action is created we would access header
data even in case the SHARED flag is not set, this would
lead to an invalid memory access.

Fixes: 3a6c50215c07 ("net/mlx5/hws: support multi-pattern")

Cc: stable@dpdk.org

Signed-off-by: Alex Vesker <valex@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index 084d4d606e..562fb5cbb4 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -1775,7 +1775,9 @@ mlx5dr_action_handle_tunnel_l3_to_l2(struct mlx5dr_action *action,
 
 	/* Create a full modify header action list in case shared */
 	mlx5dr_action_prepare_decap_l3_actions(hdrs->sz, mh_data, &num_of_actions);
-	mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions);
+
+	if (action->flags & MLX5DR_ACTION_FLAG_SHARED)
+		mlx5dr_action_prepare_decap_l3_data(hdrs->data, mh_data, num_of_actions);
 
 	/* All DecapL3 cases require the same max arg size */
 	arg_obj = mlx5dr_arg_create_modify_header_arg(ctx,
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-24 22:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 10:01 [PATCH] net/mlx5/hws: fix invalid memory access in decapl3 Gregory Etelson
2024-03-24 22:21 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).