Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] genetlink: fix netns vs. netlink table locking (2)
Date: Thu, 24 Sep 2009 15:45:44 -0700 (PDT)	[thread overview]
Message-ID: <20090924.154544.101536082.davem@davemloft.net> (raw)
In-Reply-To: <1253698470.4458.48.camel@johannes.local>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Wed, 23 Sep 2009 11:34:30 +0200

> Similar to commit d136f1bd366fdb7e747ca7e0218171e7a00a98a5,
> there's a bug when unregistering a generic netlink family,
> which is caught by the might_sleep() added in that commit:
> 
>     BUG: sleeping function called from invalid context at net/netlink/af_netlink.c:183
>     in_atomic(): 1, irqs_disabled(): 0, pid: 1510, name: rmmod
>     2 locks held by rmmod/1510:
>      #0:  (genl_mutex){+.+.+.}, at: [<ffffffff8138283b>] genl_unregister_family+0x2b/0x130
>      #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8138270c>] __genl_unregister_mc_group+0x1c/0x120
>     Pid: 1510, comm: rmmod Not tainted 2.6.31-wl #444
>     Call Trace:
>      [<ffffffff81044ff9>] __might_sleep+0x119/0x150
>      [<ffffffff81380501>] netlink_table_grab+0x21/0x100
>      [<ffffffff813813a3>] netlink_clear_multicast_users+0x23/0x60
>      [<ffffffff81382761>] __genl_unregister_mc_group+0x71/0x120
>      [<ffffffff81382866>] genl_unregister_family+0x56/0x130
>      [<ffffffffa0007d85>] nl80211_exit+0x15/0x20 [cfg80211]
>      [<ffffffffa000005a>] cfg80211_exit+0x1a/0x40 [cfg80211]
> 
> Fix in the same way by grabbing the netlink table lock
> before doing rcu_read_lock().
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

Applied.

      reply	other threads:[~2009-09-24 22:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23  9:34 [PATCH] genetlink: fix netns vs. netlink table locking (2) Johannes Berg
2009-09-24 22:45 ` 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=20090924.154544.101536082.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.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