From: Pablo Neira <pablo@eurodev.net>
To: Patrick McHardy <kaber@trash.net>
Cc: mateusz@republika.pl, netfilter-devel@lists.netfilter.org
Subject: Re: FIX: connlimit NULL pointer kernel panic
Date: Sun, 19 Jun 2005 14:12:37 +0200 [thread overview]
Message-ID: <42B56135.2010703@eurodev.net> (raw)
In-Reply-To: <42AAFD32.1000608@trash.net>
[-- Attachment #1: Type: text/plain, Size: 558 bytes --]
Patrick McHardy wrote:
> Pablo Neira wrote:
>
>>Forte Systems - Iosif Peterfi wrote:
>>
>>
>>>Here is a diff -urN patch for what has been discussed except the
>>>conntrack
>>>event-api. Works fine on 2.6.1-gentoo-r8, patch-o-matic-ng-20050516.
>>
>>
>>Hm, didn't I also tell you that you have to sed
>>'s/spin_unlock/spin_unlock_bh'?
>>
>>well, it doesn't matter, attached the correct patch that applies cleanly
>>to pom-ng.
>
>
> Thanks Pablo, I've applied the patch. Can you send patches for the 2.4
> and the old 2.6 version too?
Attached.
--
Pablo
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2614 bytes --]
Index: linux/net/ipv4/netfilter/ipt_connlimit.c
===================================================================
--- linux/net/ipv4/netfilter/ipt_connlimit.c (revision 3889)
+++ linux/net/ipv4/netfilter/ipt_connlimit.c (working copy)
@@ -55,7 +55,7 @@
struct ipt_connlimit_conn *conn;
struct list_head *hash,*lh;
- spin_lock(&data->lock);
+ spin_lock_bh(&data->lock);
tuple = ct->tuplehash[0].tuple;
hash = &data->iphash[ipt_iphash(addr & mask)];
@@ -63,8 +63,8 @@
for (lh = hash->next; lh != hash; lh = lh->next) {
conn = list_entry(lh,struct ipt_connlimit_conn,list);
found = ip_conntrack_find_get(&conn->tuple,ct);
- if (0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
- found != NULL &&
+ if (found != NULL &&
+ 0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
/* Just to be sure we have it only once in the list.
We should'nt see tuples twice unless someone hooks this
@@ -117,7 +117,7 @@
list_add(&conn->list,hash);
matches++;
}
- spin_unlock(&data->lock);
+ spin_unlock_bh(&data->lock);
return matches;
}
Index: linux-2.6/net/ipv4/netfilter/ipt_connlimit.c
===================================================================
--- linux-2.6/net/ipv4/netfilter/ipt_connlimit.c (revision 3889)
+++ linux-2.6/net/ipv4/netfilter/ipt_connlimit.c (working copy)
@@ -55,7 +55,7 @@
struct ipt_connlimit_conn *conn;
struct list_head *hash,*lh;
- spin_lock(&data->lock);
+ spin_lock_bh(&data->lock);
tuple = ct->tuplehash[0].tuple;
hash = &data->iphash[ipt_iphash(addr & mask)];
@@ -63,9 +63,9 @@
for (lh = hash->next; lh != hash; lh = lh->next) {
conn = list_entry(lh,struct ipt_connlimit_conn,list);
found = ip_conntrack_find_get(&conn->tuple,ct);
- if (0 == memcmp(&conn->tuple,&tuple,sizeof(tuple)) &&
- found != NULL &&
- found->ctrack->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
+ if (found != NULL
+ && 0 == memcmp(&conn->tuple,&tuple,sizeof(tuple))
+ && found->proto.tcp.state != TCP_CONNTRACK_TIME_WAIT) {
/* Just to be sure we have it only once in the list.
We should'nt see tuples twice unless someone hooks this
into a table without "-p tcp --syn" */
@@ -110,7 +110,7 @@
#endif
conn = kmalloc(sizeof(*conn),GFP_ATOMIC);
if (NULL == conn) {
- spin_unlock(&data->lock);
+ spin_unlock_bh(&data->lock);
return -1;
}
memset(conn,0,sizeof(*conn));
@@ -119,7 +119,7 @@
list_add(&conn->list,hash);
matches++;
}
- spin_unlock(&data->lock);
+ spin_unlock_bh(&data->lock);
return matches;
}
next prev parent reply other threads:[~2005-06-19 12:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050519075405.7DF8640023@socios.momona.org>
2005-05-19 11:30 ` FIX: connlimit NULL pointer kernel panic (was: connlimit patch crashes 2.6.11 kernel) Pablo Neira
2005-06-11 15:03 ` FIX: connlimit NULL pointer kernel panic Patrick McHardy
2005-06-19 12:12 ` Pablo Neira [this message]
2005-06-19 12:18 ` Patrick McHardy
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=42B56135.2010703@eurodev.net \
--to=pablo@eurodev.net \
--cc=kaber@trash.net \
--cc=mateusz@republika.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.