netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
@ 2007-11-18 19:00 David
  2007-11-18 19:31 ` Ismail Dönmez
  0 siblings, 1 reply; 14+ messages in thread
From: David @ 2007-11-18 19:00 UTC (permalink / raw)
  To: netdev

I'm (very) far from being firewall configuration expert, but I'm seeing
a consistent kernel panic when the following rule is triggered.

    iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
5061 --to-ports 5060

(I'm trying to redirect an alternate port to a SIP server)

Am I just being very stupid, or is there something I'm not seeing here?

Thanks
David


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-18 19:00 Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8) David
@ 2007-11-18 19:31 ` Ismail Dönmez
  2007-11-18 19:34   ` David
  0 siblings, 1 reply; 14+ messages in thread
From: Ismail Dönmez @ 2007-11-18 19:31 UTC (permalink / raw)
  To: David; +Cc: netdev

Sunday 18 November 2007 Tarihinde 21:00:12 yazmıştı:
> I'm (very) far from being firewall configuration expert, but I'm seeing
> a consistent kernel panic when the following rule is triggered.
>
>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
> 5061 --to-ports 5060
>
> (I'm trying to redirect an alternate port to a SIP server)
>
> Am I just being very stupid, or is there something I'm not seeing here?

Also post the kernel panic log.


-- 
Faith is believing what you know isn't so -- Mark Twain

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-18 19:31 ` Ismail Dönmez
@ 2007-11-18 19:34   ` David
  2007-11-18 19:54     ` Patrick McHardy
  0 siblings, 1 reply; 14+ messages in thread
From: David @ 2007-11-18 19:34 UTC (permalink / raw)
  To: Ismail Dönmez; +Cc: netdev

Ismail Dönmez wrote:
> Sunday 18 November 2007 Tarihinde 21:00:12 yazmıştı:
>   
>> I'm (very) far from being firewall configuration expert, but I'm seeing
>> a consistent kernel panic when the following rule is triggered.
>>
>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
>> 5061 --to-ports 5060
>>
>> (I'm trying to redirect an alternate port to a SIP server)
>>
>> Am I just being very stupid, or is there something I'm not seeing here?
>>     
>
> Also post the kernel panic log.
>   
This is a bit difficult since the server is headless (normally). I can
try to obtain the panic via a temporary console, but it may have to wait
for a day or two.

David

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-18 19:34   ` David
@ 2007-11-18 19:54     ` Patrick McHardy
  2007-11-19 18:51       ` David
  0 siblings, 1 reply; 14+ messages in thread
From: Patrick McHardy @ 2007-11-18 19:54 UTC (permalink / raw)
  To: David; +Cc: Ismail Dönmez, netdev

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

David wrote:
> Ismail Dönmez wrote:
>   
>> Sunday 18 November 2007 Tarihinde 21:00:12 yazmıştı:
>>   
>>     
>>> I'm (very) far from being firewall configuration expert, but I'm seeing
>>> a consistent kernel panic when the following rule is triggered.
>>>
>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
>>> 5061 --to-ports 5060
>>>
>>> (I'm trying to redirect an alternate port to a SIP server)
>>>
>>> Am I just being very stupid, or is there something I'm not seeing here?
>>>     
>>>       
>> Also post the kernel panic log.
>>   
>>     
> This is a bit difficult since the server is headless (normally). I can
> try to obtain the panic via a temporary console, but it may have to wait
> for a day or two.
>   

Please try if this patch fixes the problem.

[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1545 bytes --]

[NETFILTER]: Fix NULL pointer dereference in nf_nat_move_storage()

Reported by Chuck Ebbert as:

	https://bugzilla.redhat.com/show_bug.cgi?id=259501#c14

This routine is called each time hash should be replaced, nf_conn has
extension list which contains pointers to connection tracking users
(like nat, which is right now the only such user), so when replace takes
place it should copy own extensions. Loop above checks for own
extension, but tries to move higer-layer one, which can lead to above
oops.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>

---
commit 7799652557d966e49512479f4d3b9079bbc01fff
tree c0895084e075bf53697a66816e6bfcbe28d3859d
parent a5a97263a9fd6a94f954d41ae3233ea65a90bd8a
author Evgeniy Polyakov <johnpol@2ka.mipt.ru> Thu, 15 Nov 2007 15:52:32 -0800
committer David S. Miller <davem@davemloft.net> Thu, 15 Nov 2007 15:52:32 -0800

 net/netfilter/nf_conntrack_extend.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index a1a65a1..cf6ba66 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -109,7 +109,7 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
 			rcu_read_lock();
 			t = rcu_dereference(nf_ct_ext_types[i]);
 			if (t && t->move)
-				t->move(ct, ct->ext + ct->ext->offset[id]);
+				t->move(ct, ct->ext + ct->ext->offset[i]);
 			rcu_read_unlock();
 		}
 		kfree(ct->ext);

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-18 19:54     ` Patrick McHardy
@ 2007-11-19 18:51       ` David
  2007-11-19 19:24         ` Evgeniy Polyakov
  0 siblings, 1 reply; 14+ messages in thread
From: David @ 2007-11-19 18:51 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Ismail Dönmez, netdev

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

Patrick McHardy wrote:
>>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
>>>> 5061 --to-ports 5060
>>>>
>>>>         
>>> Also post the kernel panic log.
>>>       
>
> Please try if this patch fixes the problem.

No luck with the patch I'm afraid, panic log attached (of patched kernel).

Thanks
David

[-- Attachment #2: 19112007003.jpg --]
[-- Type: image/jpeg, Size: 80246 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-19 18:51       ` David
@ 2007-11-19 19:24         ` Evgeniy Polyakov
  2007-11-19 19:31           ` Evgeniy Polyakov
  0 siblings, 1 reply; 14+ messages in thread
From: Evgeniy Polyakov @ 2007-11-19 19:24 UTC (permalink / raw)
  To: David; +Cc: Patrick McHardy, Ismail Dönmez, netdev

On Mon, Nov 19, 2007 at 06:51:38PM +0000, David (david@unsolicited.net) wrote:
> Patrick McHardy wrote:
> >>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
> >>>> 5061 --to-ports 5060
> >>>>
> >>>>         
> >>> Also post the kernel panic log.
> >>>       
> >
> > Please try if this patch fixes the problem.
> 
> No luck with the patch I'm afraid, panic log attached (of patched kernel).

Ok, let's try it hard way.
Please check attached patch and tell if it helped (it will produce
some debug though).
What is a load on this machine? Is it simple enough to reproduce?
I will take closer look tomorrow if this will not help.

Thanks.

diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 70e7997..7dc3496 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -607,13 +607,13 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
 	struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
 	struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
 	struct nf_conn *ct = old_nat->ct;
-	unsigned int srchash;
+	
+	printk("conntrack: %p, new: %p, old: %p, ct: %p.\n",
+			conntrack, new_nat, old_nat, ct);
 
-	if (!(ct->status & IPS_NAT_DONE_MASK))
+	if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
 		return;
 
-	srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
 	write_lock_bh(&nf_nat_lock);
 	hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
 	new_nat->ct = ct;

-- 
	Evgeniy Polyakov

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-19 19:24         ` Evgeniy Polyakov
@ 2007-11-19 19:31           ` Evgeniy Polyakov
  2007-11-19 19:59             ` David
  0 siblings, 1 reply; 14+ messages in thread
From: Evgeniy Polyakov @ 2007-11-19 19:31 UTC (permalink / raw)
  To: David; +Cc: Patrick McHardy, Ismail Dönmez, netdev

On Mon, Nov 19, 2007 at 10:24:23PM +0300, Evgeniy Polyakov (johnpol@2ka.mipt.ru) wrote:
> On Mon, Nov 19, 2007 at 06:51:38PM +0000, David (david@unsolicited.net) wrote:
> > Patrick McHardy wrote:
> > >>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
> > >>>> 5061 --to-ports 5060
> > >>>>
> > >>>>         
> > >>> Also post the kernel panic log.
> > >>>       
> > >
> > > Please try if this patch fixes the problem.
> > 
> > No luck with the patch I'm afraid, panic log attached (of patched kernel).
> 
> Ok, let's try it hard way.
> Please check attached patch and tell if it helped (it will produce
> some debug though).

With both patches applied - one Patrick showed and this one.

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-19 19:31           ` Evgeniy Polyakov
@ 2007-11-19 19:59             ` David
  2007-11-20 11:55               ` Evgeniy Polyakov
  0 siblings, 1 reply; 14+ messages in thread
From: David @ 2007-11-19 19:59 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: Patrick McHardy, Ismail Dönmez, netdev

Evgeniy Polyakov wrote:
> On Mon, Nov 19, 2007 at 10:24:23PM +0300, Evgeniy Polyakov (johnpol@2ka.mipt.ru) wrote:
>   
>> On Mon, Nov 19, 2007 at 06:51:38PM +0000, David (david@unsolicited.net) wrote:
>>     
>>> Patrick McHardy wrote:
>>>       
>>>>>>>     iptables -t nat -A PREROUTING -j REDIRECT -i eth2 -p udp --dport
>>>>>>> 5061 --to-ports 5060
>>>>>>>
>>>>>>>         
>>>>>>>               
>>>>>> Also post the kernel panic log.
>>>>>>       
>>>>>>             
>>>> Please try if this patch fixes the problem.
>>>>         
>>> No luck with the patch I'm afraid, panic log attached (of patched kernel).
>>>       
>> Ok, let's try it hard way.
>> Please check attached patch and tell if it helped (it will produce
>> some debug though).
>>     
>
> With both patches applied - one Patrick showed and this one.
>   
Now works, with this in dmesg

conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.

Cheers
David



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-19 19:59             ` David
@ 2007-11-20 11:55               ` Evgeniy Polyakov
  2007-11-20 12:09                 ` David Miller
  2007-11-20 12:11                 ` Patrick McHardy
  0 siblings, 2 replies; 14+ messages in thread
From: Evgeniy Polyakov @ 2007-11-20 11:55 UTC (permalink / raw)
  To: David; +Cc: Patrick McHardy, Ismail Dönmez, netdev, davem

> >> Ok, let's try it hard way.
> >> Please check attached patch and tell if it helped (it will produce
> >> some debug though).
> >
> > With both patches applied - one Patrick showed and this one.
> >   
> Now works, with this in dmesg
> 
> conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.

David (Miller :), please apply attached patch, which also needed to fix
netfilter connection tracking bug.
When connection tracking entry (nf_conn) is about to copy itself it can
have some of its extension users (like nat) as being already freed and
thus not required to be copied.
Frankly saying, it can be not the correct fix, but from code observation
and test, perfomed by David <david@unsolicited.net> it is.

Actually looking at this function I suspect it was copied from
nf_nat_setup_info() and thus bug was introduced.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>

diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 70e7997..86b465b 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
 	struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
 	struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
 	struct nf_conn *ct = old_nat->ct;
-	unsigned int srchash;
 
-	if (!(ct->status & IPS_NAT_DONE_MASK))
+	if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
 		return;
 
-	srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
-
 	write_lock_bh(&nf_nat_lock);
 	hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
 	new_nat->ct = ct;

-- 
	Evgeniy Polyakov

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-20 11:55               ` Evgeniy Polyakov
@ 2007-11-20 12:09                 ` David Miller
  2007-11-20 12:11                 ` Patrick McHardy
  1 sibling, 0 replies; 14+ messages in thread
From: David Miller @ 2007-11-20 12:09 UTC (permalink / raw)
  To: johnpol; +Cc: david, kaber, ismail, netdev

From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Date: Tue, 20 Nov 2007 14:55:20 +0300

> > >> Ok, let's try it hard way.
> > >> Please check attached patch and tell if it helped (it will produce
> > >> some debug though).
> > >
> > > With both patches applied - one Patrick showed and this one.
> > >   
> > Now works, with this in dmesg
> > 
> > conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.
> 
> David (Miller :), please apply attached patch, which also needed to fix
> netfilter connection tracking bug.
> When connection tracking entry (nf_conn) is about to copy itself it can
> have some of its extension users (like nat) as being already freed and
> thus not required to be copied.
> Frankly saying, it can be not the correct fix, but from code observation
> and test, perfomed by David <david@unsolicited.net> it is.
> 
> Actually looking at this function I suspect it was copied from
> nf_nat_setup_info() and thus bug was introduced.
> 
> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>

Evgeniy, thanks for figuring this out.

I think it is fair to let Patrick take a quick look at this
before it is applied (and Linus is away until next week
anyways so there is no rush :-)

I suspect this error might live elsewhere too, so perhaps a good
audit should be done for this kind of thing as well so we can
kill all such gremlins now.

Thanks again.

> diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
> index 70e7997..86b465b 100644
> --- a/net/ipv4/netfilter/nf_nat_core.c
> +++ b/net/ipv4/netfilter/nf_nat_core.c
> @@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old)
>  	struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT);
>  	struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old;
>  	struct nf_conn *ct = old_nat->ct;
> -	unsigned int srchash;
>  
> -	if (!(ct->status & IPS_NAT_DONE_MASK))
> +	if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
>  		return;
>  
> -	srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
> -
>  	write_lock_bh(&nf_nat_lock);
>  	hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource);
>  	new_nat->ct = ct;
> 
> -- 
> 	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-20 11:55               ` Evgeniy Polyakov
  2007-11-20 12:09                 ` David Miller
@ 2007-11-20 12:11                 ` Patrick McHardy
  2007-11-20 12:24                   ` Patrick McHardy
  1 sibling, 1 reply; 14+ messages in thread
From: Patrick McHardy @ 2007-11-20 12:11 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: David, Ismail Dönmez, netdev, davem

Evgeniy Polyakov wrote:
>>>> Ok, let's try it hard way.
>>>> Please check attached patch and tell if it helped (it will produce
>>>> some debug though).
>>> With both patches applied - one Patrick showed and this one.
>>>   
>> Now works, with this in dmesg
>>
>> conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.
> 
> David (Miller :), please apply attached patch, which also needed to fix
> netfilter connection tracking bug.
> When connection tracking entry (nf_conn) is about to copy itself it can
> have some of its extension users (like nat) as being already freed and
> thus not required to be copied.
> Frankly saying, it can be not the correct fix, but from code observation
> and test, perfomed by David <david@unsolicited.net> it is.

I also don't believe this can be correct, let me look into this
first.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-20 12:11                 ` Patrick McHardy
@ 2007-11-20 12:24                   ` Patrick McHardy
  2007-11-20 12:27                     ` David Miller
  2007-11-20 13:22                     ` Evgeniy Polyakov
  0 siblings, 2 replies; 14+ messages in thread
From: Patrick McHardy @ 2007-11-20 12:24 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: David, Ismail Dönmez, netdev, davem

Patrick McHardy wrote:
> Evgeniy Polyakov wrote:
>>>>> Ok, let's try it hard way.
>>>>> Please check attached patch and tell if it helped (it will produce
>>>>> some debug though).
>>>> With both patches applied - one Patrick showed and this one.
>>>>   
>>> Now works, with this in dmesg
>>>
>>> conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.
>>
>> David (Miller :), please apply attached patch, which also needed to fix
>> netfilter connection tracking bug.
>> When connection tracking entry (nf_conn) is about to copy itself it can
>> have some of its extension users (like nat) as being already freed and
>> thus not required to be copied.
>> Frankly saying, it can be not the correct fix, but from code observation
>> and test, perfomed by David <david@unsolicited.net> it is.
> 
> I also don't believe this can be correct, let me look into this
> first.


I now understand whats happening:

- new connection is allocated without helper
- connection is REDIRECTed to localhost
- nf_nat_setup_info adds NAT extension, but doesn't initialize it yet
- nf_conntrack_alter_reply performs a helper lookup based on the
   new tuple, finds the SIP helper and allocates a helper extension,
   causing reallocation because of too little space
- nf_nat_move_storage is called with the uninitialized nat extension

So your fix is entirely correct, thanks a lot :)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-20 12:24                   ` Patrick McHardy
@ 2007-11-20 12:27                     ` David Miller
  2007-11-20 13:22                     ` Evgeniy Polyakov
  1 sibling, 0 replies; 14+ messages in thread
From: David Miller @ 2007-11-20 12:27 UTC (permalink / raw)
  To: kaber; +Cc: johnpol, david, ismail, netdev

From: Patrick McHardy <kaber@trash.net>
Date: Tue, 20 Nov 2007 13:24:17 +0100

> I now understand whats happening:
> 
> - new connection is allocated without helper
> - connection is REDIRECTed to localhost
> - nf_nat_setup_info adds NAT extension, but doesn't initialize it yet
> - nf_conntrack_alter_reply performs a helper lookup based on the
>    new tuple, finds the SIP helper and allocates a helper extension,
>    causing reallocation because of too little space
> - nf_nat_move_storage is called with the uninitialized nat extension
> 
> So your fix is entirely correct, thanks a lot :)

Great, I've applied Evgeniy's patch.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8)
  2007-11-20 12:24                   ` Patrick McHardy
  2007-11-20 12:27                     ` David Miller
@ 2007-11-20 13:22                     ` Evgeniy Polyakov
  1 sibling, 0 replies; 14+ messages in thread
From: Evgeniy Polyakov @ 2007-11-20 13:22 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David, Ismail Dönmez, netdev, davem

On Tue, Nov 20, 2007 at 01:24:17PM +0100, Patrick McHardy (kaber@trash.net) wrote:
> Patrick McHardy wrote:
> >Evgeniy Polyakov wrote:
> >>>>>Ok, let's try it hard way.
> >>>>>Please check attached patch and tell if it helped (it will produce
> >>>>>some debug though).
> >>>>With both patches applied - one Patrick showed and this one.
> >>>>  
> >>>Now works, with this in dmesg
> >>>
> >>>conntrack: ea94159c, new: ead4d7c4, old: ead4d7d0, ct: 00000000.
> >>
> >>David (Miller :), please apply attached patch, which also needed to fix
> >>netfilter connection tracking bug.
> >>When connection tracking entry (nf_conn) is about to copy itself it can
> >>have some of its extension users (like nat) as being already freed and
> >>thus not required to be copied.
> >>Frankly saying, it can be not the correct fix, but from code observation
> >>and test, perfomed by David <david@unsolicited.net> it is.
> >
> >I also don't believe this can be correct, let me look into this
> >first.
> 
> 
> I now understand whats happening:
> 
> - new connection is allocated without helper
> - connection is REDIRECTed to localhost
> - nf_nat_setup_info adds NAT extension, but doesn't initialize it yet
> - nf_conntrack_alter_reply performs a helper lookup based on the
>   new tuple, finds the SIP helper and allocates a helper extension,
>   causing reallocation because of too little space
> - nf_nat_move_storage is called with the uninitialized nat extension
> 
> So your fix is entirely correct, thanks a lot :)

It is always better to check my third eye revelations :)
Thanks for checking it.

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-11-20 13:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-18 19:00 Netfilter: kernel panic with REDIRECT target. (2.6.23 and 2.6.23.8) David
2007-11-18 19:31 ` Ismail Dönmez
2007-11-18 19:34   ` David
2007-11-18 19:54     ` Patrick McHardy
2007-11-19 18:51       ` David
2007-11-19 19:24         ` Evgeniy Polyakov
2007-11-19 19:31           ` Evgeniy Polyakov
2007-11-19 19:59             ` David
2007-11-20 11:55               ` Evgeniy Polyakov
2007-11-20 12:09                 ` David Miller
2007-11-20 12:11                 ` Patrick McHardy
2007-11-20 12:24                   ` Patrick McHardy
2007-11-20 12:27                     ` David Miller
2007-11-20 13:22                     ` Evgeniy Polyakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).