[dpdk-dev] [PATCH] net/mlx5: fix missing attribute size for drop action

Yongseok Koh yskoh at mellanox.com
Wed Jan 10 18:50:38 CET 2018


Adding the size of ibv_flow_spec_action_drop is missing. This can cause
overflow when converting rte_flow to ibv_flow and thus corrupt memory.

Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable at dpdk.org

Signed-off-by: Yongseok Koh <yskoh at mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 305b2ec01..ff9fd78d5 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -868,6 +868,10 @@ priv_flow_convert_items_validate(struct priv *priv,
 				parser->queue[n].offset += cur_item->dst_sz;
 		}
 	}
+	if (parser->drop) {
+		parser->queue[HASH_RXQ_ETH].offset +=
+			sizeof(struct ibv_flow_spec_action_drop);
+	}
 	if (parser->mark) {
 		for (i = 0; i != hash_rxq_init_n; ++i)
 			parser->queue[i].offset +=
-- 
2.11.0



More information about the dev mailing list