From: Patrick McHardy <kaber@trash.net>
To: Harald Welte <laforge@netfilter.org>
Cc: Henrik Nordstrom <hno@marasystems.com>,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>
Subject: Re: nat/conntrack helper locking problem?
Date: Thu, 20 Nov 2003 12:59:21 +0100 [thread overview]
Message-ID: <3FBCAC99.6020902@trash.net> (raw)
In-Reply-To: <3FBCAAF7.3040704@trash.net>
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
Sorry Harald the last patch added an unneccessary NULL assignment,
this patch is better. It fixes ip_nat_helper_register calling
ip_ct_find_helper
without holding ip_conntrack_lock.
Best regards,
Patrick
Patrick McHardy wrote:
> It's a relative uncritical error, ip_nat_helper_register races with
> ip_conntrack_helper_unregister. The attached patch should
> fix it.
>
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 617 bytes --]
===== net/ipv4/netfilter/ip_nat_helper.c 1.11 vs edited =====
--- 1.11/net/ipv4/netfilter/ip_nat_helper.c Mon Oct 13 21:40:48 2003
+++ edited/net/ipv4/netfilter/ip_nat_helper.c Thu Nov 20 12:57:22 2003
@@ -471,8 +471,11 @@
if (me->me && !(me->flags & IP_NAT_HELPER_F_STANDALONE)) {
struct ip_conntrack_helper *ct_helper;
- if ((ct_helper = ip_ct_find_helper(&me->tuple))
- && ct_helper->me) {
+ READ_LOCK(&ip_conntrack_lock);
+ ct_helper = ip_ct_find_helper(&me->tuple);
+ READ_UNLOCK(&ip_conntrack_lock);
+
+ if (ct_helper && ct_helper->me) {
__MOD_INC_USE_COUNT(ct_helper->me);
} else {
next prev parent reply other threads:[~2003-11-20 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-20 9:55 nat/conntrack helper locking problem? Henrik Nordstrom
2003-11-20 10:03 ` Patrick McHardy
2003-11-20 11:15 ` Henrik Nordstrom
2003-11-20 11:52 ` Patrick McHardy
2003-11-20 11:59 ` Patrick McHardy [this message]
2003-11-20 12:08 ` Henrik Nordstrom
2003-11-20 12:11 ` Patrick McHardy
2003-11-20 12:24 ` Henrik Nordstrom
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=3FBCAC99.6020902@trash.net \
--to=kaber@trash.net \
--cc=hno@marasystems.com \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.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.