Skip to contentSkip to conversation

Patch "bridge: Fix VLAN reference count problem" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Mar 7, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

bridge: Fix VLAN reference count problem

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bridge-fix-vlan-reference-count-problem.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Mar 6 19:02:12 PST 2018

From: Ido Schimmel <[email protected]>
Date: Sun, 25 Feb 2018 21:59:06 +0200
Subject: bridge: Fix VLAN reference count problem

From: Ido Schimmel <[email protected]>

[ Upstream commit 0e5a82efda872c2469c210957d7d4161ef8f4391 ]

When a VLAN is added on a port, a reference is taken on the corresponding master VLAN entry. If it does not already exist, then it is created and a reference taken.

However, in the second case a reference is not really taken when CONFIG_REFCOUNT_FULL is enabled as refcount_inc() is replaced by refcount_inc_not_zero().

Fix this by using refcount_set() on a newly created master VLAN entry.

Fixes 251277598596 ("net, bridge: convert net_bridge_vlan.refcnt from atomic_t to refcount_t")
---
 net/bridge/br_vlan.c |    2 ++
 1 file changed, 2 insertions(+)
net/bridge/br_vlan.c +2 -0
@@ -157,6 +157,8 @@ static struct net_bridge_vlan *br_vlan_g
 		masterv = br_vlan_find(vg, vid);
 		if (WARN_ON(!masterv))
 			return NULL;
+		refcount_set(&masterv->refcnt, 1);
+		return masterv;
 	}
 	refcount_inc(&masterv->refcnt);
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/mlxsw-spectrum_router-fix-error-path-in-mlxsw_sp_vr_create.patch queue-4.14/mlxsw-spectrum_router-do-not-unconditionally-clear-route-offload-indication.patch queue-4.14/bridge-fix-vlan-reference-count-problem.patch queue-4.14/net-ipv4-set-addr_type-in-hash_keys-for-forwarded-case.patch queue-4.14/mlxsw-spectrum_switchdev-check-success-of-fdb-add-operation.patch