Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef5e0d82 authored by Andrey Vagin's avatar Andrey Vagin Committed by David S. Miller
Browse files

bridge: Fix potential deadlock on br->multicast_lock



multicast_lock is taken in softirq context, so we should use
spin_lock_bh() in userspace.

call-chain in softirq context:
run_timer_softirq()
	br_multicast_query_expired()

call-chain in userspace:
sysfs_write_file()
	store_multicast_snooping()
		br_multicast_toggle()

Signed-off-by: default avatarAndrew Vagin <avagin@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 731abb9c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1770,7 +1770,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
	int err = 0;
	struct net_bridge_mdb_htable *mdb;

	spin_lock(&br->multicast_lock);
	spin_lock_bh(&br->multicast_lock);
	if (br->multicast_disabled == !val)
		goto unlock;

@@ -1806,7 +1806,7 @@ int br_multicast_toggle(struct net_bridge *br, unsigned long val)
	}

unlock:
	spin_unlock(&br->multicast_lock);
	spin_unlock_bh(&br->multicast_lock);

	return err;
}