From: Patrick McHardy <kaber@trash.net>
To: ¶¶Ù© <doublefacer007@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kernel BUG in ip_nat_helper_unregister at netfilter/ip_nat_helper.c
Date: Sun, 03 Sep 2006 16:46:19 +0200 [thread overview]
Message-ID: <44FAEABB.90207@trash.net> (raw)
In-Reply-To: <ccbc91640609030716o221dad8as9278b2081a28c490@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]
¶¶Ù© wrote:
> When the num of conntrack is up to 15000,I rmmod the ip_nat_ftp
> and ip_conntrack _ftp modules by typing "modprobe -r ip_nat_ftp"
> command and then the kernel is dead locked.
> I think that the dead lock is caused by ip_conntrack_lock and
> ip_nat_lock.When I rmmod the ip_nat_ftp module, the function flow is
> as following:
> ip_nat_helper_unregister->ip_ct_selective_cleanup->get_next_corpse(ip_conntrack_lock)
>
> ->kill_helper(ip_nat_lock)
> But the kernel there is another flow is as following:
> ip_nat_fn(ip_nat_lock)->ip_nat_setup_info->ip_conntrack_alter_reply(ip_conntrack_lock)
Good spotting. The lock in kill_helper is unnecessary since the helper
is not changed once set and new connections can't get the helper that
is beeing unregistered assigned since it is already removed from the
list at this point.
Please try if this patch helps.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 475 bytes --]
--- a/net/ipv4/netfilter/ip_nat_helper.c 2006-09-03 16:41:53.000000000 +0200
+++ b/net/ipv4/netfilter/ip_nat_helper.c 2006-09-03 16:42:04.000000000 +0200
@@ -522,13 +522,7 @@
static int
kill_helper(const struct ip_conntrack *i, void *helper)
{
- int ret;
-
- READ_LOCK(&ip_nat_lock);
- ret = (i->nat.info.helper == helper);
- READ_UNLOCK(&ip_nat_lock);
-
- return ret;
+ return (i->nat.info.helper == helper);
}
void ip_nat_helper_unregister(struct ip_nat_helper *me)
prev parent reply other threads:[~2006-09-03 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-03 14:16 kernel BUG in ip_nat_helper_unregister at netfilter/ip_nat_helper.c 董董侃
2006-09-03 14:46 ` Patrick McHardy [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=44FAEABB.90207@trash.net \
--to=kaber@trash.net \
--cc=doublefacer007@gmail.com \
--cc=linux-kernel@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 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.