Skip to contentSkip to conversation

net/sfc: fix MAC address entry leak in transfer flow parsing

PATCH Applied Ivan Malov 3 participants 3 messages Feb 14, 2023 Network drivers

lore
Share & tools
lore

Ivan Malov

author
#0 lore raw

PATCH 1/1 net/sfc: fix MAC address entry leak in transfer flow parsing

When the action parsing helper discovers it can "attach" to an existing action set, it must invoke "delete" on the MAC address(es) that it has "attached" to during parsing. That is because the action set itself (i.e. not the flow rule entry) holds a reference of the address(es).

Fixes 4c6005999e41 ("net/sfc: support MAC address edits in transfer flows")
---
 drivers/net/sfc/sfc_mae.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/sfc/sfc_mae.c +2 -0
index aab697b204..c254562696 100644
@@ -3912,6 +3912,8 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 
 	spec_mae->action_set = sfc_mae_action_set_attach(sa, &ctx);
 	if (spec_mae->action_set != NULL) {
+		sfc_mae_mac_addr_del(sa, ctx.src_mac);
+		sfc_mae_mac_addr_del(sa, ctx.dst_mac);
 		sfc_mae_encap_header_del(sa, ctx.encap_header);
 		efx_mae_action_set_spec_fini(sa->nic, ctx.spec);
 		return 0;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ivan Malov

When the action parsing helper discovers it can "attach" to an existing action set, it must invoke "delete" on the MAC address(es) that it has "attached" to during parsing. That is because the action set itself (i.e. not the flow rule entry) holds a reference of the address(es).

Quoted 6 lines
Fixes 4c6005999e41 ("net/sfc: support MAC address edits in transfer flows")
Applied
#2 lore raw
Quoted 11 lines · Andrew Rybchenko
Quoted 10 lines · Ivan Malov

When the action parsing helper discovers it can "attach" to an existing action set, it must invoke "delete" on the MAC address(es) that it has "attached" to during parsing. That is because the action set itself (i.e. not the flow rule entry) holds a reference of the address(es).

Fixes 4c6005999e41 ("net/sfc: support MAC address edits in transfer

flows")
Cc: [email protected]

Quoted 8 lines
Quoted 4 lines
Reviewed-by Viacheslav Galaktionov

<[email protected]>

Applied to dpdk-next-net/main, thanks.