[PATCH net] openvswitch: fix error return code in validate_and_copy_dec_ttl()

Subsystems: networking [general], openvswitch, the rest

STALE2110d LANDED

Landed in mainline as bb2da7651a47 on 2020-12-04.

3 messages, 3 authors, 2020-12-04 · open the first message on its own page

[PATCH net] openvswitch: fix error return code in validate_and_copy_dec_ttl()

From: Wang Hai <hidden>
Date: 2020-12-04 11:38:41

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Fixes: 69929d4c49e1 ("net: openvswitch: fix TTL decrement action netlink message format")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wang Hai <redacted>
---
 net/openvswitch/flow_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index ec0689ddc635..4c5c2331e764 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2531,7 +2531,7 @@ static int validate_and_copy_dec_ttl(struct net *net,
 
 	action_start = add_nested_action_start(sfa, OVS_DEC_TTL_ATTR_ACTION, log);
 	if (action_start < 0)
-		return start;
+		return action_start;
 
 	err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type,
 				     vlan_tci, mpls_label_count, log);
-- 
2.17.1

Re: [PATCH net] openvswitch: fix error return code in validate_and_copy_dec_ttl()

From: "Eelco Chaudron" <echaudro@redhat.com>
Date: 2020-12-04 12:09:30


On 4 Dec 2020, at 12:43, Wang Hai wrote:
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Fixes: 69929d4c49e1 ("net: openvswitch: fix TTL decrement action 
netlink message format")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wang Hai <redacted>
Thanks for fixing!

Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
quoted hunk
---
 net/openvswitch/flow_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow_netlink.c 
b/net/openvswitch/flow_netlink.c
index ec0689ddc635..4c5c2331e764 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2531,7 +2531,7 @@ static int validate_and_copy_dec_ttl(struct net 
*net,

 	action_start = add_nested_action_start(sfa, OVS_DEC_TTL_ATTR_ACTION, 
log);
 	if (action_start < 0)
-		return start;
+		return action_start;

 	err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type,
 				     vlan_tci, mpls_label_count, log);
-- 
2.17.1

Re: [PATCH net] openvswitch: fix error return code in validate_and_copy_dec_ttl()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-12-04 23:45:50

On Fri, 04 Dec 2020 13:07:48 +0100 Eelco Chaudron wrote:
quoted
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Changing 'return start' to 'return action_start' can fix this bug.

Fixes: 69929d4c49e1 ("net: openvswitch: fix TTL decrement action 
netlink message format")
Reported-by: Hulk Robot <redacted>
Signed-off-by: Wang Hai <redacted>  
Thanks for fixing!

Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
Applied, thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help