From: Patrick McHardy <kaber@trash.net>
To: Thomas Graf <tgraf@suug.ch>
Cc: Jarek Poplawski <jarkao2@gmail.com>,
Marcel Holtmann <marcel@holtmann.org>,
netdev@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: netlink circular locking dependency
Date: Tue, 17 Jun 2008 15:19:33 +0200 [thread overview]
Message-ID: <4857B9E5.3070102@trash.net> (raw)
In-Reply-To: <20080617130825.GD20815@postel.suug.ch>
Thomas Graf wrote:
> * Jarek Poplawski <jarkao2@gmail.com> 2008-06-17 13:09
>> On Tue, Jun 17, 2008 at 02:50:19PM +0200, Patrick McHardy wrote:
>> ...
>>> Thanks for testing. Unfortunately the module unload races look
>>> more complicated to fix and I'm busy with other things, so it
>>> would great if someone else could fix this.
>> Patrick, I wonder if simply adding an additional mutex e.g.
>> genl_lock_table() around all the rest (after your patch) genl_locks
>> could be enough until some major rework. This should prevent any
>> new races and there are no lockups, I guess?
>
> It would be wise to redo the locking alltogether while we're fixing
> this. Decouple message serialization from register/unregister
> operations would be a nice thing f.e.
Agreed.
> I'll have a look if none beats me to it.
While whoever is at this, there are a few similar races I
wanted to fix for a long time, but never got to it.
- the rtnl_register/rtnl_unregister function don't perform any
locking, so they might get called while unregistration is
in progress
- the individual ops are registered one at a time, which could
theoretically lead to some strange behaviour where a subset of
the ops can already be used, but others return EOPNOTSUPP
- netlink_dump_start usage in rtnetlink has the exact same
race as genetlink with my patch
For 1. and 2., it seems the best way would be to register the
entire set of ops (encapsulated in a struct) at once and hold
the rtnl_mutex during that. For 3., the fix would probably
identical to the genetlink fix.
next prev parent reply other threads:[~2008-06-17 13:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-14 12:35 netlink circular locking dependency Marcel Holtmann
2008-06-16 21:34 ` Jarek Poplawski
2008-06-16 21:48 ` Patrick McHardy
2008-06-17 1:45 ` Marcel Holtmann
2008-06-17 12:50 ` Patrick McHardy
2008-06-17 13:09 ` Jarek Poplawski
2008-06-17 13:07 ` Patrick McHardy
2008-06-17 13:24 ` Jarek Poplawski
2008-06-17 13:27 ` Patrick McHardy
2008-06-17 13:43 ` Jarek Poplawski
2008-06-18 4:30 ` David Miller
2008-06-18 6:15 ` Jarek Poplawski
2008-06-18 8:52 ` Patrick McHardy
2008-06-18 9:08 ` David Miller
2008-06-18 11:38 ` Marcel Holtmann
2008-06-18 11:42 ` Patrick McHardy
2008-06-17 13:08 ` Thomas Graf
2008-06-17 13:19 ` Patrick McHardy [this message]
2008-06-17 8:49 ` Jarek Poplawski
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=4857B9E5.3070102@trash.net \
--to=kaber@trash.net \
--cc=jarkao2@gmail.com \
--cc=marcel@holtmann.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=tgraf@suug.ch \
/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).