netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] genetlink: fix netns vs. netlink table locking
Date: Mon, 14 Sep 2009 17:07:04 -0700 (PDT)	[thread overview]
Message-ID: <20090914.170704.38918868.davem@davemloft.net> (raw)
In-Reply-To: <1252760595.23427.20.camel@johannes.local>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Sat, 12 Sep 2009 07:03:15 -0600

> Since my commits introducing netns awareness into
> genetlink we can get this problem:
> 
> BUG: scheduling while atomic: modprobe/1178/0x00000002
> 2 locks held by modprobe/1178:
>  #0:  (genl_mutex){+.+.+.}, at: [<ffffffff8135ee1a>] genl_register_mc_grou
>  #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8135eeb5>] genl_register_mc_g
> Pid: 1178, comm: modprobe Not tainted 2.6.31-rc8-wl-34789-g95cb731-dirty #
> Call Trace:
>  [<ffffffff8103e285>] __schedule_bug+0x85/0x90
>  [<ffffffff81403138>] schedule+0x108/0x588
>  [<ffffffff8135b131>] netlink_table_grab+0xa1/0xf0
>  [<ffffffff8135c3a7>] netlink_change_ngroups+0x47/0x100
>  [<ffffffff8135ef0f>] genl_register_mc_group+0x12f/0x290
> 
> because I overlooked that netlink_table_grab() will
> schedule, thinking it was just the rwlock. However,
> in the contention case, that isn't actually true.
> 
> Fix this by letting the code grab the netlink table
> lock first and then the RCU for netns protection.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

Applied, thanks.

      reply	other threads:[~2009-09-15  0:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 15:59 [PATCH] genetlink: fix netns vs. netlink table locking Johannes Berg
2009-09-12 13:03 ` [PATCH v2] " Johannes Berg
2009-09-15  0:07   ` 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=20090914.170704.38918868.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).