From: Mike Pattrick Date: Tue, 22 Mar 2022 03:19:37 +0000 (-0400) Subject: net/i40e: populate error in flow director parser X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=87063aaff3752470af21f3b80b257262d9d4a314;p=dpdk.git net/i40e: populate error in flow director parser Errors from i40e_flow_parse_fdir_pattern() can bubble up to rte_flow_create. If rte_flow_error is not initialized a caller may dereference error->message. This may be uninitialized memory, leading to a segemntation fault. Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate") Cc: stable@dpdk.org Signed-off-by: Mike Pattrick Reviewed-by: David Marchand --- diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index e0cf996200..4f3808cb5f 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -3142,8 +3142,11 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, /* Check if the input set is valid */ if (i40e_validate_input_set(pctype, RTE_ETH_FILTER_FDIR, input_set) != 0) { - PMD_DRV_LOG(ERR, "Invalid input set"); - return -EINVAL; + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Invalid input set"); + return -rte_errno; } filter->input.flow_ext.input_set = input_set;