From: Pavel Emelyanov <xemul@openvz.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
Linux Netdev List <netdev@vger.kernel.org>,
devel@openvz.org
Subject: Re: [PATCH (resubmit)] Fix inet_diag.ko register vs rcv race
Date: Mon, 03 Dec 2007 12:01:06 +0300 [thread overview]
Message-ID: <4753C5D2.1050704@openvz.org> (raw)
In-Reply-To: <20071203045622.GA20636@gondor.apana.org.au>
Herbert Xu wrote:
> On Thu, Nov 29, 2007 at 04:01:25PM +0300, Pavel Emelyanov wrote:
>> @@ -863,13 +861,13 @@ int inet_diag_register(const struct inet_diag_handler *h)
>> if (type >= INET_DIAG_GETSOCK_MAX)
>> goto out;
>>
>> - spin_lock(&inet_diag_register_lock);
>> + mutex_lock(&inet_diag_mutex);
>> err = -EEXIST;
>> if (inet_diag_table[type] == NULL) {
>> inet_diag_table[type] = h;
>> err = 0;
>> }
>> - spin_unlock(&inet_diag_register_lock);
>> + mutex_unlock(&inet_diag_mutex);
>
> Actually this causes a dead-lock when the handlers are built as modules
> because we try to load them with that mutex held.
Ouch! Sorry, I didn't notice this :(
> I've fixed it with this patch on top.
Thanks!
> Cheers,
Pavel
prev parent reply other threads:[~2007-12-03 9:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 13:01 [PATCH (resubmit)] Fix inet_diag.ko register vs rcv race Pavel Emelyanov
2007-11-29 13:10 ` Herbert Xu
2007-12-03 4:56 ` Herbert Xu
2007-12-03 9:01 ` Pavel Emelyanov [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=4753C5D2.1050704@openvz.org \
--to=xemul@openvz.org \
--cc=acme@redhat.com \
--cc=devel@openvz.org \
--cc=herbert@gondor.apana.org.au \
--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).