idpf: Fix flow rule delete failure due to invalid validation
Subsystems (3)
PATCH 1/1 idpf: Fix flow rule delete failure due to invalid validation
When deleting a flow rule using "ethtool -N <dev> delete <location>", idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even though ethtool doesn't populate this field for delete operations. The uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check and ring_cookie validation during delete operations since action validation is not required when removing existing rules.
--- drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -3
@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev, vport_config = vport->adapter->vport_config[np->vport_idx]; user_config = &vport_config->user_config; -if (!idpf_sideband_action_ena (vport, fsp)) -return -EOPNOTSUPP ; - rule =kzalloc (struct_size (rule, rule_info,1 ),GFP_KERNEL );if (!rule)return -ENOMEM ;
Signature · 1 line
2.25.1
Quoted 9 lines · Sreedevi Joshi
When deleting a flow rule using "ethtool -N <dev> delete <location>",
idpf_sideband_action_ena()incorrectly validatesfsp->ring_cookieeven though ethtool doesn't populate this field for delete operations. The uninitializedring_cookiemay randomly matchRX_CLS_FLOW_DISCorRX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check andring_cookievalidation during delete operations since action validation is not required when removing existing rules.
Quoted 3 lines
Fixes ada3e24b84a0 ("idpf: add flow steering support")Signed-off-by Sreedevi Joshi <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>
Thanks,
I agree with your analysis.
And that the problem was introduced by the cited commit.
[Cc: +Ahmed Zaki]
Dear Sreedevi,
Thank you for your patch.
Am 13.01.26 um 19:01 schrieb Sreedevi Joshi:
Quoted 21 lines
When deleting a flow rule using "ethtool -N <dev> delete <location>",
idpf_sideband_action_ena()incorrectly validatesfsp->ring_cookieeven though ethtool doesn't populate this field for delete operations. The uninitializedring_cookiemay randomly matchRX_CLS_FLOW_DISCorRX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check andring_cookievalidation during delete operations since action validation is not required when removing existing rules.Fixes ada3e24b84a0 ("idpf: add flow steering support")Signed-off-by Sreedevi Joshi <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>--- drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 --- 1 file changed, 3 deletions(-)drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0
-0
drivers/net/ethernet/intel/idpf/idpf_ethtool.c static int idpf_del_flow_steer(struct net_device *netdev, · line 312
Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0
-3@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev, vport_config = vport->adapter->vport_config[np->vport_idx]; user_config = &vport_config->user_config; -if (!idpf_sideband_action_ena (vport, fsp)) -return -EOPNOTSUPP ; - rule =kzalloc (struct_size (rule, rule_info,1 ),GFP_KERNEL );if (!rule)return -ENOMEM ;
Kind regards,
Paul
[Cc: Remove Ahmed as address bounces]
Am 16.01.26 um 18:39 schrieb Paul Menzel:
Quoted 43 lines
Dear Sreedevi,
Thank you for your patch.
Am 13.01.26 um 19:01 schrieb Sreedevi Joshi:
Quoted 21 lines
When deleting a flow rule using "ethtool -N <dev> delete <location>",
idpf_sideband_action_ena()incorrectly validatesfsp->ring_cookieeven though ethtool doesn't populate this field for delete operations. The uninitializedring_cookiemay randomly matchRX_CLS_FLOW_DISCorRX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check andring_cookievalidation during delete operations since action validation is not required when removing existing rules.Fixes ada3e24b84a0 ("idpf: add flow steering support")Signed-off-by Sreedevi Joshi <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>---
drivers/net/ethernet/intel/idpf/idpf_ethtool.c| 3 ---1 file changed, 3 deletions(-)drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0
-0drivers/net/ethernet/intel/idpf/idpf_ethtool.c static int idpf_del_flow_steer(struct net_device · line 312
Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0
-3@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev, vport_config = vport->adapter->vport_config[np->vport_idx]; user_config = &vport_config->user_config; - if (!idpf_sideband_action_ena(vport, fsp)) - return -EOPNOTSUPP; - rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL); if (!rule) return -ENOMEM;Reviewed-by Paul Menzel <[email protected]>Kind regards,
Paul