net/mlx5/hws: fix invalid memory access in decapl3
PATCH 1/1 net/mlx5/hws: fix invalid memory access in decapl3
From: Alex Vesker <[email protected]>
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")
Signed-off-by Alex Vesker <[email protected]>
--- drivers/net/mlx5/hws/mlx5dr_action.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/hws/mlx5dr_action.c +3 -1
@@ -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,
Signature · 1 line
2.39.2
Thomas Monjalon
Applied22/03/2024 11:01, Gregory Etelson:
Quoted 11 lines
From: Alex Vesker <[email protected]>
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")Signed-off-by Alex Vesker <[email protected]>
Applied, thanks.