lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D7E5F2B.1070007@trash.net>
Date:	Mon, 14 Mar 2011 19:32:11 +0100
From:	Patrick McHardy <kaber@...sh.net>
To:	Changli Gao <xiaosuo@...il.com>
CC:	Jan Engelhardt <jengelh@...ozas.de>,
	"David S. Miller" <davem@...emloft.net>,
	netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 1/4] netfilter: xt_connlimit: fix daddr connlimit in SNAT
 scenario

On 14.03.2011 13:42, Changli Gao wrote:
> On Mon, Mar 14, 2011 at 8:26 PM, Jan Engelhardt <jengelh@...ozas.de> wrote:
>> On Monday 2011-03-14 07:50, Changli Gao wrote:
>>
>>> We use the reply tuples when limiting the connections by the destination
>>> addresses, however, in SNAT scenario, the final reply tuples won't be
>>> ready until SNAT is done in POSTROUING or INPUT chain
>>
>> If I am not mistaken: if you do daddr counting, SNAT is irrelevant.
>> Consider ruleset
>>  -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 1.2.3.4:80
>>  -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to 1.2.3.5:443
>>
>> The tuple will first be (as per conntrack -L):
>>  src=home dst=router src=router dst=home
>> After DNAT:
>>  src=home dst=router src=1.2.3.4 dst=home
>>
>> Thus looking at the src of the reply tuple seems correct — at least this
>> is what was wanted, counting per stashed servers (=1 customer), not per
>> globally visible address.
>>
> 
> Yes, you are correct only when there is no SNAT rule. If there is an SNAT rule:
> 
> -t nat -A POSTROUTING -p tcp --dport 80 -j SNAT --to-source 192.168.0.1
> 
> the final tuples will be:
> src = home dst = router src=1.2.3.4 dst=192.168.0.1
> 
> However, the tuple saved by connlimit is src=1.2.3.4 dst=home, so this
> conn will be removed later as there isn't any conntrack, which has
> this tuple in any direction.
> 
> You can't prevent a user from doing such a configuration, although you
> might think it is stupid to do that.
> 
> Thanks for your review.

Jan, please let me know whether you want me to apply these patches.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ