mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
Merge branch 'net-openvswitch-fix-skb-leak-on-flow-key-update-failure'
Ilya Maximets says: ==================== net: openvswitch: fix skb leak on flow key update failure Fixes for two issues reported by Sashiko while reviewing other patches. The root cause is the same, fixes and the Fixes are slightly different, so two separate patches. ==================== Link: https://patch.msgid.link/20260727181851.306076-1-i.maximets@ovn.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
4107af9967
|
|
@ -1108,6 +1108,10 @@ static int execute_masked_set_action(struct sk_buff *skb,
|
|||
return err;
|
||||
}
|
||||
|
||||
/* When 'last' is true, recirc() should always consume the 'skb'.
|
||||
* Otherwise, recirc() should keep 'skb' intact regardless what
|
||||
* actions are executed on recirculation.
|
||||
*/
|
||||
static int execute_recirc(struct datapath *dp, struct sk_buff *skb,
|
||||
struct sw_flow_key *key,
|
||||
const struct nlattr *a, bool last)
|
||||
|
|
@ -1118,8 +1122,12 @@ static int execute_recirc(struct datapath *dp, struct sk_buff *skb,
|
|||
int err;
|
||||
|
||||
err = ovs_flow_key_update(skb, key);
|
||||
if (err)
|
||||
if (err) {
|
||||
if (last)
|
||||
ovs_kfree_skb_reason(skb,
|
||||
OVS_DROP_ACTION_ERROR);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
BUG_ON(!is_flow_key_valid(key));
|
||||
|
||||
|
|
@ -1372,7 +1380,7 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
|
|||
if (!is_flow_key_valid(key)) {
|
||||
err = ovs_flow_key_update(skb, key);
|
||||
if (err)
|
||||
return err;
|
||||
break;
|
||||
}
|
||||
|
||||
err = ovs_ct_execute(ovs_dp_get_net(dp), skb, key,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user