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

Message ID 20180110175038.34374-1-yskoh@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Yongseok Koh Jan. 10, 2018, 5:50 p.m. UTC
  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@dpdk.org

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

Comments

Shahaf Shuler Jan. 15, 2018, 6:50 a.m. UTC | #1
Wednesday, January 10, 2018 7:51 PM, Yongseok Koh:
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix missing attribute size for drop
> action
> 
> 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@dpdk.org
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Applied to next-net-mlx, thanks
  

Patch

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 +=