All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
       [not found] <200602131628.k1DGSpc3019846@toshiba.co.jp>
@ 2006-02-13 16:44 ` Patrick McHardy
  2006-02-14  3:48   ` Yasuyuki KOZAKAI
       [not found]   ` <200602140348.k1E3msEc020481@toshiba.co.jp>
  2006-02-15 10:10 ` Patrick McHardy
  1 sibling, 2 replies; 11+ messages in thread
From: Patrick McHardy @ 2006-02-13 16:44 UTC (permalink / raw)
  To: Yasuyuki KOZAKAI; +Cc: netfilter-devel, usagi-core, laforge

Yasuyuki KOZAKAI wrote:
> Hi,
> 
> These patches make nf_ct_attach work fine in IPv6 stack.
> 
> The locally generated reply packets in IPv6 stack, such as ICMPv6 error
> and TCP RST by REJECT target, need to be associated with the connection
> of original packet.

The reason why we manually attach these references (at least for ICMP)
is because the packet might be in the middle of two NAT manips and
unrecognizable for conntrack. For IPv6 this should be irrelevant. I'm
not sure why it is done for TCP RSTs, they should always be properly
tracked anyway.

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-13 16:44 ` [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack Patrick McHardy
@ 2006-02-14  3:48   ` Yasuyuki KOZAKAI
       [not found]   ` <200602140348.k1E3msEc020481@toshiba.co.jp>
  1 sibling, 0 replies; 11+ messages in thread
From: Yasuyuki KOZAKAI @ 2006-02-14  3:48 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel, usagi-core, laforge, yasuyuki.kozakai


From: Patrick McHardy <kaber@trash.net>
Date: Mon, 13 Feb 2006 17:44:30 +0100

> Yasuyuki KOZAKAI wrote:
> > Hi,
> > 
> > These patches make nf_ct_attach work fine in IPv6 stack.
> > 
> > The locally generated reply packets in IPv6 stack, such as ICMPv6 error
> > and TCP RST by REJECT target, need to be associated with the connection
> > of original packet.
> 
> The reason why we manually attach these references (at least for ICMP)
> is because the packet might be in the middle of two NAT manips and
> unrecognizable for conntrack. For IPv6 this should be irrelevant. I'm
> not sure why it is done for TCP RSTs, they should always be properly
> tracked anyway.

It's common case for me that the conntrack of original TCP packet is
unconfirmed at processing in REJECT target. In this case, TCP RST
generated by REJECT causes to create new conntrack. I don't think
that is good behavior. That can be said about sending ICMPv6 error.

-- Yasuyuki Kozakai

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
       [not found]   ` <200602140348.k1E3msEc020481@toshiba.co.jp>
@ 2006-02-14 16:26     ` Patrick McHardy
  2006-02-14 17:59       ` Yasuyuki KOZAKAI
       [not found]       ` <200602141759.k1EHxfk0009760@toshiba.co.jp>
  0 siblings, 2 replies; 11+ messages in thread
From: Patrick McHardy @ 2006-02-14 16:26 UTC (permalink / raw)
  To: Yasuyuki KOZAKAI; +Cc: netfilter-devel, usagi-core, laforge

Yasuyuki KOZAKAI wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 13 Feb 2006 17:44:30 +0100
> 
>>
>>The reason why we manually attach these references (at least for ICMP)
>>is because the packet might be in the middle of two NAT manips and
>>unrecognizable for conntrack. For IPv6 this should be irrelevant. I'm
>>not sure why it is done for TCP RSTs, they should always be properly
>>tracked anyway.
> 
> 
> It's common case for me that the conntrack of original TCP packet is
> unconfirmed at processing in REJECT target. In this case, TCP RST
> generated by REJECT causes to create new conntrack. I don't think
> that is good behavior. That can be said about sending ICMPv6 error.

Unless I'm missing something, that shouldn't happen.
__{ip,nf}_conntrack_confirm check that the packet is in direction
IP_CT_DIR_ORIGINAL before confirming the conntrack.

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-14 16:26     ` Patrick McHardy
@ 2006-02-14 17:59       ` Yasuyuki KOZAKAI
       [not found]       ` <200602141759.k1EHxfk0009760@toshiba.co.jp>
  1 sibling, 0 replies; 11+ messages in thread
From: Yasuyuki KOZAKAI @ 2006-02-14 17:59 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel, usagi-core, laforge, yasuyuki.kozakai


From: Patrick McHardy <kaber@trash.net>
Date: Tue, 14 Feb 2006 17:26:32 +0100

> > It's common case for me that the conntrack of original TCP packet is
> > unconfirmed at processing in REJECT target. In this case, TCP RST
> > generated by REJECT causes to create new conntrack. I don't think
> > that is good behavior. That can be said about sending ICMPv6 error.
> 
> Unless I'm missing something, that shouldn't happen.
> __{ip,nf}_conntrack_confirm check that the packet is in direction
> IP_CT_DIR_ORIGINAL before confirming the conntrack.

IIRC, __{ip,nf}_conntrack_confirm is called at POSTROUTING and INPUT,
after all processing of packet filter. If I do

	ip6tables -A FORWARD -p tcp --dport 22 -j REJECT

on my router, the conntrack of TCP SYN packet of ssh will never confirmed
and then nf_conntrack will create new conntrack for TCP RST at OUTPUT.

-- Yasuyuki Kozakai

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
       [not found]       ` <200602141759.k1EHxfk0009760@toshiba.co.jp>
@ 2006-02-14 18:13         ` Patrick McHardy
  2006-02-14 18:35           ` Yasuyuki KOZAKAI
  2006-02-14 20:41           ` Jozsef Kadlecsik
  0 siblings, 2 replies; 11+ messages in thread
From: Patrick McHardy @ 2006-02-14 18:13 UTC (permalink / raw)
  To: Yasuyuki KOZAKAI; +Cc: netfilter-devel, usagi-core, laforge

Yasuyuki KOZAKAI wrote:
> IIRC, __{ip,nf}_conntrack_confirm is called at POSTROUTING and INPUT,
> after all processing of packet filter. If I do
> 
> 	ip6tables -A FORWARD -p tcp --dport 22 -j REJECT
> 
> on my router, the conntrack of TCP SYN packet of ssh will never confirmed
> and then nf_conntrack will create new conntrack for TCP RST at OUTPUT.

RSTs and ICMP errors without existing connections should be ignored
by conntrack (and marked as INVALID). Are you sure the RSTs create
new conntracks?

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-14 18:13         ` Patrick McHardy
@ 2006-02-14 18:35           ` Yasuyuki KOZAKAI
  2006-02-14 20:41           ` Jozsef Kadlecsik
  1 sibling, 0 replies; 11+ messages in thread
From: Yasuyuki KOZAKAI @ 2006-02-14 18:35 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel, usagi-core, laforge, yasuyuki.kozakai


From: Patrick McHardy <kaber@trash.net>
Date: Tue, 14 Feb 2006 19:13:16 +0100

> Yasuyuki KOZAKAI wrote:
> > IIRC, __{ip,nf}_conntrack_confirm is called at POSTROUTING and INPUT,
> > after all processing of packet filter. If I do
> > 
> > 	ip6tables -A FORWARD -p tcp --dport 22 -j REJECT
> > 
> > on my router, the conntrack of TCP SYN packet of ssh will never confirmed
> > and then nf_conntrack will create new conntrack for TCP RST at OUTPUT.
> 
> RSTs and ICMP errors without existing connections should be ignored
> by conntrack (and marked as INVALID). Are you sure the RSTs create
> new conntracks?

Yes.

OK, I'll stop to mind the behavior - allocating conntrack at once and destroy
it after all.

But INVALID is appropriate mark for them ?

-- Yasuyuki Kozakai

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-14 18:13         ` Patrick McHardy
  2006-02-14 18:35           ` Yasuyuki KOZAKAI
@ 2006-02-14 20:41           ` Jozsef Kadlecsik
  2006-02-15  7:47             ` Harald Welte
  1 sibling, 1 reply; 11+ messages in thread
From: Jozsef Kadlecsik @ 2006-02-14 20:41 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: netfilter-devel, usagi-core, laforge, Yasuyuki KOZAKAI

On Tue, 14 Feb 2006, Patrick McHardy wrote:

> Yasuyuki KOZAKAI wrote:
> > IIRC, __{ip,nf}_conntrack_confirm is called at POSTROUTING and INPUT,
> > after all processing of packet filter. If I do
> >
> > 	ip6tables -A FORWARD -p tcp --dport 22 -j REJECT
> >
> > on my router, the conntrack of TCP SYN packet of ssh will never confirmed
> > and then nf_conntrack will create new conntrack for TCP RST at OUTPUT.
>
> RSTs and ICMP errors without existing connections should be ignored
> by conntrack (and marked as INVALID). Are you sure the RSTs create
> new conntracks?

Marking packets created by the REJECT target as INVALID would break
the functionality of the target itself. Even if there is no real
"master" connection, RELATED was more appropriate.

Best regards,
Jozsef
-
E-mail  : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
          H-1525 Budapest 114, POB. 49, Hungary

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-14 20:41           ` Jozsef Kadlecsik
@ 2006-02-15  7:47             ` Harald Welte
  2006-02-15  9:01               ` Patrick McHardy
  0 siblings, 1 reply; 11+ messages in thread
From: Harald Welte @ 2006-02-15  7:47 UTC (permalink / raw)
  To: Jozsef Kadlecsik
  Cc: netfilter-devel, usagi-core, Patrick McHardy, Yasuyuki KOZAKAI

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

On Tue, Feb 14, 2006 at 09:41:59PM +0100, Jozsef Kadlecsik wrote:
> On Tue, 14 Feb 2006, Patrick McHardy wrote:
> 
> > Yasuyuki KOZAKAI wrote:
> > > IIRC, __{ip,nf}_conntrack_confirm is called at POSTROUTING and INPUT,
> > > after all processing of packet filter. If I do
> > >
> > > 	ip6tables -A FORWARD -p tcp --dport 22 -j REJECT
> > >
> > > on my router, the conntrack of TCP SYN packet of ssh will never confirmed
> > > and then nf_conntrack will create new conntrack for TCP RST at OUTPUT.
> >
> > RSTs and ICMP errors without existing connections should be ignored
> > by conntrack (and marked as INVALID). Are you sure the RSTs create
> > new conntracks?
> 
> Marking packets created by the REJECT target as INVALID would break
> the functionality of the target itself. Even if there is no real
> "master" connection, RELATED was more appropriate.

I totally agree.  Also, we have to keep 100% semantic compatibility with
the existing ip_conntrack setups, otherwise we'd confuse users and
create lots of broken packet filters.

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
  2006-02-15  7:47             ` Harald Welte
@ 2006-02-15  9:01               ` Patrick McHardy
  0 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2006-02-15  9:01 UTC (permalink / raw)
  To: Harald Welte
  Cc: netfilter-devel, usagi-core, Yasuyuki KOZAKAI, Jozsef Kadlecsik

Harald Welte wrote:
> On Tue, Feb 14, 2006 at 09:41:59PM +0100, Jozsef Kadlecsik wrote:
> 
>>>RSTs and ICMP errors without existing connections should be ignored
>>>by conntrack (and marked as INVALID). Are you sure the RSTs create
>>>new conntracks?
>>
>>Marking packets created by the REJECT target as INVALID would break
>>the functionality of the target itself. Even if there is no real
>>"master" connection, RELATED was more appropriate.
> 
> 
> I totally agree.  Also, we have to keep 100% semantic compatibility with
> the existing ip_conntrack setups, otherwise we'd confuse users and
> create lots of broken packet filters.

Now I get it :) I assumed conntrack should recognize the ICMP or RST
as belonging to the original connection just as for forwarded packets,
but since it is not confirmed yet, this doesn't happen. So the patches
make perfect sense and I'm going to apply them now.

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

* Re: [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
       [not found] <200602131628.k1DGSpc3019846@toshiba.co.jp>
  2006-02-13 16:44 ` [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack Patrick McHardy
@ 2006-02-15 10:10 ` Patrick McHardy
  1 sibling, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2006-02-15 10:10 UTC (permalink / raw)
  To: Yasuyuki KOZAKAI; +Cc: netfilter-devel, usagi-core, laforge

Yasuyuki KOZAKAI wrote:
> These patches make nf_ct_attach work fine in IPv6 stack.
> 
> The locally generated reply packets in IPv6 stack, such as ICMPv6 error
> and TCP RST by REJECT target, need to be associated with the connection
> of original packet.

All three patches applied, thanks. I'll push them to Dave for 2.6.16
today.

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

* [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack
@ 2006-02-13 16:28 Yasuyuki KOZAKAI
  0 siblings, 0 replies; 11+ messages in thread
From: Yasuyuki KOZAKAI @ 2006-02-13 16:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: usagi-core, kaber, laforge


Hi,

These patches make nf_ct_attach work fine in IPv6 stack.

The locally generated reply packets in IPv6 stack, such as ICMPv6 error
and TCP RST by REJECT target, need to be associated with the connection
of original packet.

Please review and apply.

-- Yasuyuki Kozakai

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

end of thread, other threads:[~2006-02-15 10:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200602131628.k1DGSpc3019846@toshiba.co.jp>
2006-02-13 16:44 ` [PATCH 0/3] nf_conntrack: fixes for nf_ct_attach in IPv6 stack Patrick McHardy
2006-02-14  3:48   ` Yasuyuki KOZAKAI
     [not found]   ` <200602140348.k1E3msEc020481@toshiba.co.jp>
2006-02-14 16:26     ` Patrick McHardy
2006-02-14 17:59       ` Yasuyuki KOZAKAI
     [not found]       ` <200602141759.k1EHxfk0009760@toshiba.co.jp>
2006-02-14 18:13         ` Patrick McHardy
2006-02-14 18:35           ` Yasuyuki KOZAKAI
2006-02-14 20:41           ` Jozsef Kadlecsik
2006-02-15  7:47             ` Harald Welte
2006-02-15  9:01               ` Patrick McHardy
2006-02-15 10:10 ` Patrick McHardy
2006-02-13 16:28 Yasuyuki KOZAKAI

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.