All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH 3/3][CONNTRACK] Fix race condition in early drop
Date: Thu, 24 Aug 2006 15:02:59 +0200	[thread overview]
Message-ID: <eck80r$hbo$1@sea.gmane.org> (raw)
In-Reply-To: <eck3j5$20q$1@sea.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 125 bytes --]

On 24-08-2006 13:47, Jarek Poplawski wrote:
...

Sorry again, I'm definitely too fresh. It should be even shorter:

Jarek P.

[-- Attachment #2: nf_conntrack_core-2.6.18-rc4.diff --]
[-- Type: text/plain, Size: 720 bytes --]

--- linux-2.6.18-rc4/net/netfilter/nf_conntrack_core.c-	2006-08-22 07:55:25.000000000 +0200
+++ linux-2.6.18-rc4/net/netfilter//nf_conntrack_core.c	2006-08-24 13:34:43.000000000 +0200
@@ -905,6 +906,12 @@
 		goto out;
 	}
 
+	if (!atomic_add_unless(&nf_conntrack_count, 1, nf_conntrack_max) {
+		kmem_cache_free(nf_ct_cache[features].cachep, conntrack);
+		conntrack = NULL;
+		goto out;
+	}
+
 	memset(conntrack, 0, nf_ct_cache[features].size);
 	conntrack->features = features;
 	if (helper) {
@@ -922,7 +929,6 @@
 	conntrack->timeout.data = (unsigned long)conntrack;
 	conntrack->timeout.function = death_by_timeout;
 
-	atomic_inc(&nf_conntrack_count);
 out:
 	read_unlock_bh(&nf_ct_cache_lock);
 	return conntrack;

      reply	other threads:[~2006-08-24 13:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-21  8:47 [PATCH 3/3][CONNTRACK] Fix race condition in early drop Pablo Neira Ayuso
2006-08-22  4:35 ` Yasuyuki KOZAKAI
     [not found] ` <200608220435.k7M4ZSLf001686@toshiba.co.jp>
2006-08-22 13:46   ` Pablo Neira Ayuso
2006-08-22 14:39     ` Pablo Neira Ayuso
     [not found]       ` <200608230228.k7N2SDTf000802@toshiba.co.jp>
2006-08-23  4:38         ` Patrick McHardy
2006-08-23  2:28     ` Yasuyuki KOZAKAI
2006-08-24 11:47     ` Jarek Poplawski
2006-08-24 13:02       ` Jarek Poplawski [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='eck80r$hbo$1@sea.gmane.org' \
    --to=jarkao2@o2.pl \
    --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.