From: David Miller <davem@davemloft.net>
To: cwang@twopensource.com
Cc: shm@cumulusnetworks.com, sfeldma@cumulusnetworks.com,
netdev@vger.kernel.org, roopa@cumulusnetworks.com,
bridge@lists.linux-foundation.org, stephen@networkplumber.org
Subject: Re: [PATCH net-next 1/2] bridge: use spin_lock_bh() in br_multicast_set_hash_max
Date: Mon, 06 Jan 2014 16:41:15 -0500 (EST) [thread overview]
Message-ID: <20140106.164115.2191339437526329685.davem@davemloft.net> (raw)
In-Reply-To: <CAHA+R7MB4Pf=eF-7=3gGH-j1mmJLtrjxFqv0bBXF1BBd1D=kuQ@mail.gmail.com>
From: Cong Wang <cwang@twopensource.com>
Date: Mon, 6 Jan 2014 11:11:45 -0800
> On Mon, Jan 6, 2014 at 11:00 AM, Scott Feldman
> <sfeldma@cumulusnetworks.com> wrote:
>> From: Curt Brune <curt@cumulusnetworks.com>
>>
>> br_multicast_set_hash_max() is called from process context in
>> net/bridge/br_sysfs_br.c by the sysfs store_hash_max() function.
>>
>> br_multicast_set_hash_max() calls spin_lock(&br->multicast_lock),
>> which can deadlock the CPU if a softirq that also tries to take the
>> same lock interrupts br_multicast_set_hash_max() while the lock is
>> held . This can happen quite easily when any of the bridge multicast
>> timers expire, which try to take the same lock.
>>
>> The fix here is to use spin_lock_bh(), preventing other softirqs from
>> executing on this CPU.
>>
>> Steps to reproduce:
>>
>> 1. Create a bridge with several interfaces (I used 4).
>> 2. Set the "multicast query interval" to a low number, like 2.
>> 3. Enable the bridge as a multicast querier.
>> 4. Repeatedly set the bridge hash_max parameter via sysfs.
>>
>> # brctl addbr br0
>> # brctl addif br0 eth1 eth2 eth3 eth4
>> # brctl setmcqi br0 2
>> # brctl setmcquerier br0 1
>>
>> # while true ; do echo 4096 > /sys/class/net/br0/bridge/hash_max; done
>>
>
>
> I think this should probably go to net instead of net-next,
> and -stable too.
Agreed, applied to 'net' and queued up for -stable.
prev parent reply other threads:[~2014-01-06 21:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-06 19:00 [PATCH net-next 1/2] bridge: use spin_lock_bh() in br_multicast_set_hash_max Scott Feldman
2014-01-06 19:11 ` Cong Wang
2014-01-06 21:41 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140106.164115.2191339437526329685.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=bridge@lists.linux-foundation.org \
--cc=cwang@twopensource.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=sfeldma@cumulusnetworks.com \
--cc=shm@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).