From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Greear Subject: Re: [PATCH] bridge: make bridge-nf-call-*tables default configurable Date: Tue, 30 Jun 2009 21:14:40 -0700 Message-ID: <4A4AE2B0.7060909@candelatech.com> References: <1246379267.3749.42.camel@blaa> <20090630170027.GA22691@gondor.apana.org.au> <20090630.120608.193727499.davem@davemloft.net> <20090701011528.GA28676@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Herbert Xu , David Miller , markmc@redhat.com, netdev@vger.kernel.org, kaber@trash.net, netfilter-devel@vger.kernel.org To: Jan Engelhardt Return-path: In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netfilter-devel.vger.kernel.org Jan Engelhardt wrote: > On Wednesday 2009-07-01 03:15, Herbert Xu wrote: > >> On Tue, Jun 30, 2009 at 10:16:35PM +0200, Jan Engelhardt wrote: >> >>> It makes sense absolutely. Consider: >>> >>> * packet enters bridge >>> * NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, ...) is called by nr_netfilter.c >>> * (connection tracking entry is set up) >>> * let bridging decision be "local delivery" >>> >> No, my question is does it ever make sense to use conntrack as >> part of bridge netfilter. That is, do you ever want to test it >> in your rules that are run as part of bridge netfilter. >> > > There is the possibility that some users have -m conntrack in their > mangle table in the PREROUTING chain. However, I am pretty sure that > if there are such users, they do it because of the layer-3/4/5/7 part > and not care about bridge so much. > > >> conntrack is inherently a security hole when used as part of >> bridging, because it ignores the Ethernet header so two unrelated >> connections can be tracked as one. >> > > On secondary thought, one could also argue that because conntrack > ignores the interface, two unrelated connections happening to be routed > through the same machine(*) are tracked as one, too. > I had a similar problem while trying to implement virtual routers using different routing tables and something like 'veth' to connect them. My solution was to add a 'mark' field to the netdevice and allow user-space to set the mark on the device. This mark was included as part of the connection identifier. The mark is set before the pkt hits the bridge code on ingress, so a pkt entering from eth1 can get a different connection hash from a pkt entering eth2, even if all other data in the packet is the same. I'll dig it out of my monster patch if something like this is deemed useful upstream. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com