From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira <pablo@eurodev.net>
Cc: Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
Harald Welte <laforge@netfilter.org>
Subject: Re: [PATCH] locking issue in __unexpect_related
Date: Thu, 22 Apr 2004 01:32:54 +0200 [thread overview]
Message-ID: <408704A6.20201@trash.net> (raw)
In-Reply-To: <4086FE33.3020804@eurodev.net>
Pablo Neira wrote:
> Hi Harald and list,
>
> In the function __unexpect_related:
>
> /* delete from global and local lists */
> list_del(&expect->list);
> list_del(&expect->expected_list);
>
> If an entry of the global list of expectation is erased, shouldn't this
> operation be write_lock'ed? If missing something, please let me know.
Your patch will deadlock, the function should only be called under
write-locked ip_conntrack_lock, which you can see by the
MUST_BE_WRITE_LOCKED assertion. Check the callers ..
Regards
Patrick
>
> regards,
> Pablo
>
>
> ------------------------------------------------------------------------
>
> --- linux-2.6.3-old/net/ipv4/netfilter/ip_conntrack_core.c 2004-04-14 21:32:58.000000000 +0200
> +++ linux-2.6.3/net/ipv4/netfilter/ip_conntrack_core.c 2004-04-22 00:55:42.000000000 +0200
> @@ -226,7 +226,9 @@
> IP_NF_ASSERT(!expect->sibling);
>
> /* delete from global and local lists */
> + WRITE_LOCK(&ip_conntrack_expect_list);
> list_del(&expect->list);
> + WRITE_UNLOCK(&ip_conntrack_expect_list);
> list_del(&expect->expected_list);
>
> /* decrement expect-count of master conntrack */
prev parent reply other threads:[~2004-04-21 23:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-21 23:05 [PATCH] locking issue in __unexpect_related Pablo Neira
2004-04-21 23:32 ` 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=408704A6.20201@trash.net \
--to=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=pablo@eurodev.net \
/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.