aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_ioctl.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <razor@blackwall.org>2015-06-15 20:28:51 +0300
committerBen Hutchings <ben@decadent.org.uk>2015-08-07 00:32:17 +0100
commit41431e402fc405dcef9a468a815c68b322ad0e62 (patch)
tree6717675bf92dafde43e55b4ffaf91558aae70718 /net/bridge/br_ioctl.c
parentf563f5e04ac9f65a9f08b5d04c44f96f6a00ff72 (diff)
downloadkernel_samsung_smdk4412-41431e402fc405dcef9a468a815c68b322ad0e62.zip
kernel_samsung_smdk4412-41431e402fc405dcef9a468a815c68b322ad0e62.tar.gz
kernel_samsung_smdk4412-41431e402fc405dcef9a468a815c68b322ad0e62.tar.bz2
bridge: fix br_stp_set_bridge_priority race conditions
[ Upstream commit 2dab80a8b486f02222a69daca6859519e05781d9 ] After the ->set() spinlocks were removed br_stp_set_bridge_priority was left running without any protection when used via sysfs. It can race with port add/del and could result in use-after-free cases and corrupted lists. Tested by running port add/del in a loop with stp enabled while setting priority in a loop, crashes are easily reproducible. The spinlocks around sysfs ->set() were removed in commit: 14f98f258f19 ("bridge: range check STP parameters") There's also a race condition in the netlink priority support that is fixed by this change, but it was introduced recently and the fixes tag covers it, just in case it's needed the commit is: af615762e972 ("bridge: add ageing_time, stp_state, priority over netlink") Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Fixes: 14f98f258f19 ("bridge: range check STP parameters") Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/bridge/br_ioctl.c')
-rw-r--r--net/bridge/br_ioctl.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index 7222fe1..ea0e15c 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -246,9 +246,7 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- spin_lock_bh(&br->lock);
br_stp_set_bridge_priority(br, args[1]);
- spin_unlock_bh(&br->lock);
return 0;
case BRCTL_SET_PORT_PRIORITY: