From: Larry Finger <Larry.Finger@lwfinger.net>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: Lockdep problem
Date: Thu, 09 Jan 2014 13:14:41 -0600 [thread overview]
Message-ID: <52CEF521.90009@lwfinger.net> (raw)
In-Reply-To: <20140109162414.GA1719@redhat.com>
On 01/09/2014 10:24 AM, Stanislaw Gruszka wrote:
> On Tue, Jan 07, 2014 at 12:28:26PM -0600, Larry Finger wrote:
>> rtnl_mutex --> misc_mtx --> rfkill_global_mutex
>>
>> Possible unsafe locking scenario:
>>
>> CPU0 CPU1
>> ---- ----
>> lock(rfkill_global_mutex);
>> lock(misc_mtx);
>> lock(rfkill_global_mutex);
>> lock(rtnl_mutex);
>>
>> *** DEADLOCK ***
>
> There are 3 mutexes dependency. The deadlock can happen if on another
> cpu, let say CPU2, there will be sequence:
>
> lock(rtnl_mutex);
> lock(misc_mtx);
>
> Then on deadlock scenario:
> CPU0 waits for rtnl_mutex to unlock, keep rfkill_global_mutex locked
> CPU1 waits for rfkill_global_mutex to unlock, keep misc_mtx locked
> CPU2 waits for misc_mtx to unlock, keep rtnl_mutex locked.
>
> This dependency can be broken by moving b43_rng_init() outside from
> rtnl_mutex scope, like on below patch. IIUC b43 random number generator
> works only if we already started network connection, but this should
> not be a problem, as b43_rng_read() do not return any data if device
> is not prepared.
>
> You could also remove whole b43 rnd. Everyone know, that HW vendors
> are influenced by NSA and they random generators do not provide truly
> random numbers (just kidding ;-)
Well, I have no idea to what extent NSA affects the RNGs in computers; however,
I do like having that additional source of entropy. :)
Your analysis was spot on, and I will be submitting a patch shortly with you as
author. I'll give the reporter on b.k.o a chance to test it, but it removed the
splat here.
Thanks,
Larry
next prev parent reply other threads:[~2014-01-09 19:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 18:28 Lockdep problem Larry Finger
2014-01-09 16:24 ` Stanislaw Gruszka
2014-01-09 19:14 ` Larry Finger [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-03-08 17:10 Dmitry
2008-03-08 17:30 ` Peter Zijlstra
2008-03-08 19:00 ` Dmitry
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=52CEF521.90009@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=sgruszka@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.