net/i40e: Populate error in flow_parse_fdir_pattern
PATCH 1/1 net/i40e: Populate error in flow_parse_fdir_pattern
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.
--- drivers/net/i40e/i40e_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/i40e/i40e_flow.c +5 -2
@@ -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;
Signature · 1 line
2.27.0
Hello Mike,
Quoted 9 lines · Mike Pattrick
Errors from
i40e_flow_parse_fdir_pattern()can bubble up torte_flow_create. Ifrte_flow_erroris not initialized a caller may dereferenceerror->message. This may be uninitialized memory, leading to a segemntation fault.Signed-off-by Mike Pattrick <[email protected]>Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
Nit: the convention in DPDK is to have a block with the Fixes: and Cc:
lines together first, then the rest of the tags in a second block.
<empty line>
Quoted 23 lines
--- drivers/net/i40e/i40e_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/i40e/i40e_flow.c +5
-3@@ -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; --
Quoted 2 lines
2.27.0
Signature · 1 line
David Marchand
Zhang, Qi Z
AppliedQuoted 10 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Tuesday, March 22, 2022 4:36 PM
To: Mike Pattrick <[email protected]>
Cc: Xing, Beilei <[email protected]>; [email protected]; dev <[email protected]>; dpdk stable <[email protected]>
Subject: Re: [PATCH] net/i40e: Populate error inflow_parse_fdir_pattern
Renamed title to
"net/i40e: populate error in FDIR flow pattern parser"
To fix check-git-log warning
Quoted 45 lines
Hello Mike,
Quoted 10 lines · Mike Pattrick
Errors from
i40e_flow_parse_fdir_pattern()can bubble up torte_flow_create. Ifrte_flow_erroris not initialized a caller may dereferenceerror->message. This may be uninitialized memory, leading to a segemntation fault.Signed-off-by Mike Pattrick <[email protected]>Fixes 4a072ad43442 ("net/i40e: fix flow director config after flowvalidate")
Cc: [email protected]Nit: the convention in DPDK is to have a block with the Fixes: and Cc:
lines together first, then the rest of the tags in a second block.Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")<empty line>
Signed-off-by Mike Pattrick <[email protected]>drivers/net/i40e/i40e_flow.c i40e_flow_parse_fdir_pattern(struct
Quoted 9 lines
--- drivers/net/i40e/i40e_flow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_flow.cindexe0cf996200..4f3808cb5f100644drivers/net/i40e/i40e_flow.c +0
-0@@ -3142,8 +3142,11 @@ i40e_flow_parse_fdir_pattern(struct
rte_eth_dev*dev,Quoted 12 lines
drivers/net/i40e/i40e_flow.c +5
-2/* 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; }
Quoted 6 lines
Quoted 4 lines
drivers/net/i40e/i40e_flow.c +0
-1filter->input.flow_ext.input_set = input_set; --2.27.0
Reviewed-by David Marchand <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi
Quoted 4 lines
--
David Marchand