Skip to content

Commit 384c4cb

Browse files
Tim Yinickdesaulniers
authored andcommitted
net: bridge: vlan: fix memory leak in __allowed_ingress
When using per-vlan state, if vlan snooping and stats are disabled, untagged or priority-tagged ingress frame will go to check pvid state. If the port state is forwarding and the pvid state is not learning/forwarding, untagged or priority-tagged frame will be dropped but skb memory is not freed. Should free skb when __allowed_ingress returns false. Fixes: a580c76 ("net: bridge: vlan: add per-vlan state") Signed-off-by: Tim Yi <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8e3b28b commit 384c4cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/bridge/br_vlan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ static bool __allowed_ingress(const struct net_bridge *br,
560560
!br_opt_get(br, BROPT_VLAN_STATS_ENABLED)) {
561561
if (*state == BR_STATE_FORWARDING) {
562562
*state = br_vlan_get_pvid_state(vg);
563-
return br_vlan_state_allowed(*state, true);
564-
} else {
565-
return true;
563+
if (!br_vlan_state_allowed(*state, true))
564+
goto drop;
566565
}
566+
return true;
567567
}
568568
}
569569
v = br_vlan_find(vg, *vid);

0 commit comments

Comments
 (0)