[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc5450f0-5d60-ac5c-03dd-e42507a52465@nvidia.com>
Date: Thu, 27 Jan 2022 10:03:30 +0200
From: Nikolay Aleksandrov <nikolay@...dia.com>
To: Tim Yi <tim.yi@...a8.com>
CC: <roopa@...dia.com>, <davem@...emloft.net>, <kuba@...nel.org>,
<bridge@...ts.linux-foundation.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: bridge: vlan: fix memory leak in __allowed_ingress
On 27/01/2022 09:49, Tim Yi wrote:
> 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.
>
> Signed-off-by: Tim Yi <tim.yi@...a8.com>
> ---
> net/bridge/br_vlan.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
> index 84ba456a78cc..88c4297cddee 100644
> --- a/net/bridge/br_vlan.c
> +++ b/net/bridge/br_vlan.c
> @@ -560,10 +560,10 @@ static bool __allowed_ingress(const struct net_bridge *br,
> !br_opt_get(br, BROPT_VLAN_STATS_ENABLED)) {
> if (*state == BR_STATE_FORWARDING) {
> *state = br_vlan_get_pvid_state(vg);
> - return br_vlan_state_allowed(*state, true);
> - } else {
> - return true;
> + if (!br_vlan_state_allowed(*state, true))
> + goto drop;
> }
> + return true;
> }
> }
> v = br_vlan_find(vg, *vid);
Good catch, also should go to stable, here's the appropriate fixes tag.
Fixes: a580c76d534c ("net: bridge: vlan: add per-vlan state")
Acked-by: Nikolay Aleksandrov <nikolay@...dia.com>
Thanks,
Nik
Powered by blists - more mailing lists