<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Fixing the ipt_recent Netfilter Module	</title>
	<atom:link href="/articles/fixing-the-ipt_recent-netfilter-module/feed/" rel="self" type="application/rss+xml" />
	<link>/articles/fixing-the-ipt_recent-netfilter-module/</link>
	<description>Software Engineer and Consultant</description>
	<lastBuildDate>Sat, 29 Oct 2016 01:51:02 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Jürgen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-58668</link>

		<dc:creator><![CDATA[Jürgen Kreileder]]></dc:creator>
		<pubDate>Wed, 10 Dec 2008 23:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-58668</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-58667&quot;&gt;siva&lt;/a&gt;.

Linux uses 64-bit jiffies now, you can get higher uptimes :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-58667">siva</a>.</p>
<p>Linux uses 64-bit jiffies now, you can get higher uptimes :)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: siva		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-58667</link>

		<dc:creator><![CDATA[siva]]></dc:creator>
		<pubDate>Wed, 10 Dec 2008 14:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-58667</guid>

					<description><![CDATA[Please tell me whether Uptime continues to calculate life long...
or else it will be rolled over after 497 days...]]></description>
			<content:encoded><![CDATA[<p>Please tell me whether Uptime continues to calculate life long&#8230;<br />
or else it will be rolled over after 497 days&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Денискины рассказы &#187; Blog Archive &#187; Ошибка в модуле ipt_recent для netfilter		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-58345</link>

		<dc:creator><![CDATA[Денискины рассказы &#187; Blog Archive &#187; Ошибка в модуле ipt_recent для netfilter]]></dc:creator>
		<pubDate>Sat, 18 Oct 2008 10:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-58345</guid>

					<description><![CDATA[[...] да в модуле ipt_recent для netfilter-а оказывается есть крутой баг, делающий это ipt_recent совершенно бесполезным. Нашли его [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] да в модуле ipt_recent для netfilter-а оказывается есть крутой баг, делающий это ipt_recent совершенно бесполезным. Нашли его [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sei		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-56404</link>

		<dc:creator><![CDATA[Sei]]></dc:creator>
		<pubDate>Mon, 01 Oct 2007 05:49:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-56404</guid>

					<description><![CDATA[(continued) On i386 arch, a hit at 25 days after the last hit will result in a wrong match because ipt_recent_match() compares two unsigned long variables &quot;t&quot; and &quot;e-&#062;stamps[i]&quot; by time_after(), I believe.]]></description>
			<content:encoded><![CDATA[<p>(continued) On i386 arch, a hit at 25 days after the last hit will result in a wrong match because ipt_recent_match() compares two unsigned long variables &#8220;t&#8221; and &#8220;e-&gt;stamps[i]&#8221; by time_after(), I believe.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sei		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-56403</link>

		<dc:creator><![CDATA[Sei]]></dc:creator>
		<pubDate>Mon, 01 Oct 2007 05:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-56403</guid>

					<description><![CDATA[Hi Juergen,

My term &quot;this more_than_LONG_MAX_jiffies problem&quot; was rather unclear.
The ipt_recent code before his rewrite had several problems related to jiffies values.
With the rewrite, a problem

&#062; if the list of last hits contained empty slots and jiffies is greater than LONG_MAX

seems to be fixed, but another one

&#062; if one of the last hits was more than LONG_MAX jiffies ago

looks not to be fixed yet.
Do you mean the latter fixed too?]]></description>
			<content:encoded><![CDATA[<p>Hi Juergen,</p>
<p>My term &#8220;this more_than_LONG_MAX_jiffies problem&#8221; was rather unclear.<br />
The ipt_recent code before his rewrite had several problems related to jiffies values.<br />
With the rewrite, a problem</p>
<p>&gt; if the list of last hits contained empty slots and jiffies is greater than LONG_MAX</p>
<p>seems to be fixed, but another one</p>
<p>&gt; if one of the last hits was more than LONG_MAX jiffies ago</p>
<p>looks not to be fixed yet.<br />
Do you mean the latter fixed too?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-56370</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Sat, 29 Sep 2007 00:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-56370</guid>

					<description><![CDATA[Yeah, the rewrite fixes the problem.  I reviewed it months ago (I can&#039;t remember why it is OK off the top of my head though -- but it is OK!).]]></description>
			<content:encoded><![CDATA[<p>Yeah, the rewrite fixes the problem.  I reviewed it months ago (I can&#8217;t remember why it is OK off the top of my head though &#8212; but it is OK!).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sei		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-56190</link>

		<dc:creator><![CDATA[Sei]]></dc:creator>
		<pubDate>Thu, 20 Sep 2007 09:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-56190</guid>

					<description><![CDATA[Does Patrick McHardy&#039;s rewrite really fix this more_than_LONG_MAX_jiffies problem?
It still has a time_after() comparison of unsigned long variables.]]></description>
			<content:encoded><![CDATA[<p>Does Patrick McHardy&#8217;s rewrite really fix this more_than_LONG_MAX_jiffies problem?<br />
It still has a time_after() comparison of unsigned long variables.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rich&#8217;s rantings &#187; Blog Archive &#187; ipt_recent brokenness		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-44313</link>

		<dc:creator><![CDATA[Rich&#8217;s rantings &#187; Blog Archive &#187; ipt_recent brokenness]]></dc:creator>
		<pubDate>Mon, 15 Jan 2007 13:19:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-44313</guid>

					<description><![CDATA[[...] Then I read this bug report. It seems I have to patch the ipt_recent source&#8230; Actually, I think this is the wrong solution anyway, and I need to disable hosts at the sshd level after a few failed password attemps. [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Then I read this bug report. It seems I have to patch the ipt_recent source&#8230; Actually, I think this is the wrong solution anyway, and I need to disable hosts at the sshd level after a few failed password attemps. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-21720</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Tue, 14 Nov 2006 07:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-21720</guid>

					<description><![CDATA[Jose,

The patch that is provided by Juergen is to fix the problem in
the kernel, hence you have to apply the patch to your kernel
and then rebuild the kernel.

To apply the patch refer to Juergen&#039;s comment above, on
October 15th, 2006 at 2:06 pm]]></description>
			<content:encoded><![CDATA[<p>Jose,</p>
<p>The patch that is provided by Juergen is to fix the problem in<br />
the kernel, hence you have to apply the patch to your kernel<br />
and then rebuild the kernel.</p>
<p>To apply the patch refer to Juergen&#8217;s comment above, on<br />
October 15th, 2006 at 2:06 pm</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jose Lima		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-21294</link>

		<dc:creator><![CDATA[Jose Lima]]></dc:creator>
		<pubDate>Fri, 10 Nov 2006 23:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-21294</guid>

					<description><![CDATA[Hi,

I&#039;m running redhat EL 4 with  kernel 2.6.9-22.ELsmp

I tryed rebooting and doing the test with in 5 minutes, the rules seem to be working correctly as far as I can tell.  Is there any other way to test? or am I safe?
aslo, can some one post on how to actually apply the patch? do i have to recompile the kernel? or is this something applied when i compile iptables?

thanks for your time

BR

J]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;m running redhat EL 4 with  kernel 2.6.9-22.ELsmp</p>
<p>I tryed rebooting and doing the test with in 5 minutes, the rules seem to be working correctly as far as I can tell.  Is there any other way to test? or am I safe?<br />
aslo, can some one post on how to actually apply the patch? do i have to recompile the kernel? or is this something applied when i compile iptables?</p>
<p>thanks for your time</p>
<p>BR</p>
<p>J</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-20137</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Tue, 31 Oct 2006 06:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-20137</guid>

					<description><![CDATA[Hi Juergen,

   There is a good news. Just now i was able to reproduce the bug on my i386 box. The results are as follows.

Unpatched kernel: telnetting to the port 1234 for the second time.
The ipt_recent rule kicked in and DROPed the connection request.

Patched kernel: telnet to the port 1234 for the 7th time.
For 6 times the connection refused since we have our hit_count as 6 and for the 7th time the ipt_recent rule kicked in and DROPed the connection request.

Thank you very much for the patch and the iptables rules.]]></description>
			<content:encoded><![CDATA[<p>Hi Juergen,</p>
<p>   There is a good news. Just now i was able to reproduce the bug on my i386 box. The results are as follows.</p>
<p>Unpatched kernel: telnetting to the port 1234 for the second time.<br />
The ipt_recent rule kicked in and DROPed the connection request.</p>
<p>Patched kernel: telnet to the port 1234 for the 7th time.<br />
For 6 times the connection refused since we have our hit_count as 6 and for the 7th time the ipt_recent rule kicked in and DROPed the connection request.</p>
<p>Thank you very much for the patch and the iptables rules.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-19530</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Thu, 26 Oct 2006 05:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-19530</guid>

					<description><![CDATA[Thank u very much, I&#039;ll be waiting for your post.]]></description>
			<content:encoded><![CDATA[<p>Thank u very much, I&#8217;ll be waiting for your post.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-19458</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Wed, 25 Oct 2006 18:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-19458</guid>

					<description><![CDATA[I&#039;ll post a more detailed test setup later.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll post a more detailed test setup later.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-19418</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Wed, 25 Oct 2006 08:38:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-19418</guid>

					<description><![CDATA[Juergen, can u tell me some way to reproduce the problem. It will be very much helpful to me.]]></description>
			<content:encoded><![CDATA[<p>Juergen, can u tell me some way to reproduce the problem. It will be very much helpful to me.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-19287</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Tue, 24 Oct 2006 07:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-19287</guid>

					<description><![CDATA[Juergen i just tested my iptables by running the following rule

# iptables -P OUTPUT DROP

After this any command execution gives the error and this output for ls.

# ls
RPC: sendmsg returned error 1
nfs: RPC call returned error 1
ash: ls: Operation not permitted

So i feel there is no problem in my iptables setup.]]></description>
			<content:encoded><![CDATA[<p>Juergen i just tested my iptables by running the following rule</p>
<p># iptables -P OUTPUT DROP</p>
<p>After this any command execution gives the error and this output for ls.</p>
<p># ls<br />
RPC: sendmsg returned error 1<br />
nfs: RPC call returned error 1<br />
ash: ls: Operation not permitted</p>
<p>So i feel there is no problem in my iptables setup.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18229</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Tue, 17 Oct 2006 18:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18229</guid>

					<description><![CDATA[Please test whether your iptables setup works at all.  Just use a simple DROP rule.
(Note that the rules are not persistent, you have to setup them after each boot.)]]></description>
			<content:encoded><![CDATA[<p>Please test whether your iptables setup works at all.  Just use a simple DROP rule.<br />
(Note that the rules are not persistent, you have to setup them after each boot.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18200</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Tue, 17 Oct 2006 12:07:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18200</guid>

					<description><![CDATA[Juergen, I did the following after running your iptable rules

1. Immediately after the setup ive executed the script.
2. After the setup i rebooted the system and executed the script.

There is no difference in the output :(]]></description>
			<content:encoded><![CDATA[<p>Juergen, I did the following after running your iptable rules</p>
<p>1. Immediately after the setup ive executed the script.<br />
2. After the setup i rebooted the system and executed the script.</p>
<p>There is no difference in the output :(</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18179</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Tue, 17 Oct 2006 05:52:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18179</guid>

					<description><![CDATA[That&#039;s OK, 0 == all.

Did you try running your script again with that setup?]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s OK, 0 == all.</p>
<p>Did you try running your script again with that setup?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18173</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Tue, 17 Oct 2006 03:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18173</guid>

					<description><![CDATA[Juergen, Please find the output from “iptables -L” after entering the three iptables commands that U&#039;ve posted. One thing that i can see is that the 3rd line shows &quot;ACCEPT 0&quot; but according to you it should be &quot;ACCEPT all&quot;.

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       tcp  --  anywhere             anywhere            tcp dpt:1234 recent: UPDATE seconds: 60 hit_count: 6 name: foo side: source
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:1234 recent: SET name: foo side: source

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination]]></description>
			<content:encoded><![CDATA[<p>Juergen, Please find the output from “iptables -L” after entering the three iptables commands that U&#8217;ve posted. One thing that i can see is that the 3rd line shows &#8220;ACCEPT 0&#8221; but according to you it should be &#8220;ACCEPT all&#8221;.</p>
<p>Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     0    &#8212;  anywhere             anywhere            state RELATED,ESTABLISHED<br />
DROP       tcp  &#8212;  anywhere             anywhere            tcp dpt:1234 recent: UPDATE seconds: 60 hit_count: 6 name: foo side: source<br />
ACCEPT     tcp  &#8212;  anywhere             anywhere            tcp dpt:1234 recent: SET name: foo side: source</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18145</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 19:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18145</guid>

					<description><![CDATA[OK, looks like something went wrong when you entered the three iptables commands I&#039;ve posted &lt;a href=&quot;#comment-17958&quot; rel=&quot;nofollow&quot;&gt;above&lt;/a&gt;.

After entering the rules you should see:

&lt;pre style=&quot;overflow:scroll;width:92%;&quot;&gt;$ iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
DROP       tcp  --  anywhere             anywhere            tcp dpt:1234 recent: UPDATE seconds: 60 hit_count: 6 name: foo side: source 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:1234 recent: SET name: foo side: source 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>OK, looks like something went wrong when you entered the three iptables commands I&#8217;ve posted <a href="#comment-17958" rel="nofollow">above</a>.</p>
<p>After entering the rules you should see:</p>
<pre style="overflow:scroll;width:92%;">$ iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
DROP       tcp  --  anywhere             anywhere            tcp dpt:1234 recent: UPDATE seconds: 60 hit_count: 6 name: foo side: source 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:1234 recent: SET name: foo side: source 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18142</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 19:42:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18142</guid>

					<description><![CDATA[Juergen, Please find the output from &quot;iptables -L&quot;.  Ive used the iptables-1.3.6 version at the user mode.

For unpatched kernel:
-------------------------
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

For patched kernel:
----------------------
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

There is no difference in the &quot;iptables -L&quot; output for both the unpatched and the patched kernels. I hope u will give me a good solution.]]></description>
			<content:encoded><![CDATA[<p>Juergen, Please find the output from &#8220;iptables -L&#8221;.  Ive used the iptables-1.3.6 version at the user mode.</p>
<p>For unpatched kernel:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>For patched kernel:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Chain INPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain FORWARD (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination</p>
<p>There is no difference in the &#8220;iptables -L&#8221; output for both the unpatched and the patched kernels. I hope u will give me a good solution.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18135</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 19:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18135</guid>

					<description><![CDATA[Please post the output from &quot;iptables -L&quot;.

The expected result for you script would be;

&lt;ul&gt;
&lt;li&gt;Patched kernel: the 7th telnet call hangs (not the machine, just the command)&lt;/li&gt;
&lt;li&gt;Unpatched kernel: When one of the conditions mentioned in the article is true, the 2nd call hangs.  Otherwise it behaves like the patched kernel.&lt;/li&gt;
&lt;/ul&gt;

I&#039;ll post a more detailed test setup later.  (Might take till tomorrow
evening, I need some sleep tonight :-)]]></description>
			<content:encoded><![CDATA[<p>Please post the output from &#8220;iptables -L&#8221;.</p>
<p>The expected result for you script would be;</p>
<ul>
<li>Patched kernel: the 7th telnet call hangs (not the machine, just the command)</li>
<li>Unpatched kernel: When one of the conditions mentioned in the article is true, the 2nd call hangs.  Otherwise it behaves like the patched kernel.</li>
</ul>
<p>I&#8217;ll post a more detailed test setup later.  (Might take till tomorrow<br />
evening, I need some sleep tonight :-)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18133</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 18:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18133</guid>

					<description><![CDATA[Juergen, to repeat the telnet command rapidly enough, ive executed the following shell script which will do a telnet 1000 times to the port 1234.

#! /bin/sh

i=1
j=1000
while [ $i -ne $j ] ;
do
   telnet 43.88.102.48 1234
   i=`expr $i + 1`
done

I got the same messages &quot;unable to connect to remote host” 1000 times.

But what ive noticed is that the system did not hang even after completing 1000 iterations for both bug-fixed and bug-not-fixed kernels.

My system is a 32 bit system and ive applied the patch ipt_recent.patch that contains even the 64 bit fixes as u said. It will be helpful for me if u can tell me a clear method to reproduce the bug.]]></description>
			<content:encoded><![CDATA[<p>Juergen, to repeat the telnet command rapidly enough, ive executed the following shell script which will do a telnet 1000 times to the port 1234.</p>
<p>#! /bin/sh</p>
<p>i=1<br />
j=1000<br />
while [ $i -ne $j ] ;<br />
do<br />
   telnet 43.88.102.48 1234<br />
   i=`expr $i + 1`<br />
done</p>
<p>I got the same messages &#8220;unable to connect to remote host” 1000 times.</p>
<p>But what ive noticed is that the system did not hang even after completing 1000 iterations for both bug-fixed and bug-not-fixed kernels.</p>
<p>My system is a 32 bit system and ive applied the patch ipt_recent.patch that contains even the 64 bit fixes as u said. It will be helpful for me if u can tell me a clear method to reproduce the bug.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18116</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 14:51:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18116</guid>

					<description><![CDATA[That&#039;s the expected result, there&#039;s nothing listening on port 1234. For this test, the immediate error &quot;unable to connect to remote host&quot; means that no packets where DROPed.
If you repeat the telnet command rapidly enough, it will hang at some point. That means the ipt_recent rule kicked in and DROPed the connection request.

Of course you can also use a port with some listener (e.g. port 80 if you have web server running) for the test. But using a port with no listener is just as good in this case.]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s the expected result, there&#8217;s nothing listening on port 1234. For this test, the immediate error &#8220;unable to connect to remote host&#8221; means that no packets where DROPed.<br />
If you repeat the telnet command rapidly enough, it will hang at some point. That means the ipt_recent rule kicked in and DROPed the connection request.</p>
<p>Of course you can also use a port with some listener (e.g. port 80 if you have web server running) for the test. But using a port with no listener is just as good in this case.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-18115</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Mon, 16 Oct 2006 14:30:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-18115</guid>

					<description><![CDATA[Juergen, thank you very much for the iptable rules but im getting an error as follows.

&quot;unable to connect to remote host&quot;

My /etc/hosts contains the follwoing ip addresses
127.0.0.1
43.88.102.48

Hence i did a telnet as follows
# telnet 43.88.102.48 1234

and i got the error.]]></description>
			<content:encoded><![CDATA[<p>Juergen, thank you very much for the iptable rules but im getting an error as follows.</p>
<p>&#8220;unable to connect to remote host&#8221;</p>
<p>My /etc/hosts contains the follwoing ip addresses<br />
127.0.0.1<br />
43.88.102.48</p>
<p>Hence i did a telnet as follows<br />
# telnet 43.88.102.48 1234</p>
<p>and i got the error.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17958</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Sun, 15 Oct 2006 18:28:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17958</guid>

					<description><![CDATA[Here are some simple test rules:

&lt;pre style=&quot;overflow:scroll;width:92%;&quot;&gt;iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 1234 -m recent --update --seconds 60 --hitcount 6 --name foo -j DROP
iptables -A INPUT -p tcp --dport 1234 -m recent --set --name foo -j ACCEPT&lt;/pre&gt;

Then, &lt;strong&gt;within the first five minutes after booting&lt;/strong&gt;, try telnetting to port 1234. With a working version of ipt_recent, the rules won&#039;t block unless you connect more than six times within 60 seconds. With a broken version, the second connect will be blocked.]]></description>
			<content:encoded><![CDATA[<p>Here are some simple test rules:</p>
<pre style="overflow:scroll;width:92%;">iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 1234 -m recent --update --seconds 60 --hitcount 6 --name foo -j DROP
iptables -A INPUT -p tcp --dport 1234 -m recent --set --name foo -j ACCEPT</pre>
<p>Then, <strong>within the first five minutes after booting</strong>, try telnetting to port 1234. With a working version of ipt_recent, the rules won&#8217;t block unless you connect more than six times within 60 seconds. With a broken version, the second connect will be blocked.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17949</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Sun, 15 Oct 2006 16:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17949</guid>

					<description><![CDATA[Juergen, thank you very much for the information. If u will give me the iptable rules to reproduce the bug on linux-2.6.11 kernel it will be very helpful.]]></description>
			<content:encoded><![CDATA[<p>Juergen, thank you very much for the information. If u will give me the iptable rules to reproduce the bug on linux-2.6.11 kernel it will be very helpful.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17937</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Sun, 15 Oct 2006 12:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17937</guid>

					<description><![CDATA[The patch should work fine with 2.6.11:

&lt;pre&gt;$ cd linux-2.6.11
$ patch -NEp1 &#060; ~/ipt_recent-fix.patch
patching file include/linux/netfilter_ipv4/ipt_recent.h
patching file net/ipv4/netfilter/ipt_recent.c&lt;/pre&gt;

Let me know if you need some help with the iptable rules.
(If you&#039;re using &lt;a href=&quot;http://www.shorewall.net/&quot; rel=&quot;nofollow&quot;&gt;shorewall&lt;/a&gt;, I&#039;ve posted two rules which use ipt_recent in another &lt;a href=&quot;/2005/02/18/mitigating-ssh-brute-force-attacks-with-ipt_recent/&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt;.)]]></description>
			<content:encoded><![CDATA[<p>The patch should work fine with 2.6.11:</p>
<pre>$ cd linux-2.6.11
$ patch -NEp1 &lt; ~/ipt_recent-fix.patch
patching file include/linux/netfilter_ipv4/ipt_recent.h
patching file net/ipv4/netfilter/ipt_recent.c</pre>
<p>Let me know if you need some help with the iptable rules.<br />
(If you&#8217;re using <a href="http://www.shorewall.net/" rel="nofollow">shorewall</a>, I&#8217;ve posted two rules which use ipt_recent in another <a href="/2005/02/18/mitigating-ssh-brute-force-attacks-with-ipt_recent/" rel="nofollow">article</a>.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17936</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Sun, 15 Oct 2006 11:08:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17936</guid>

					<description><![CDATA[Juergen, Im using the linux-2.6.11 kernel and hence i need to fix the jiffies problem in it. It would be helpful if ill get a patch for only the jiffies problem because i dont want to get into backporting the ipt_recent.c code from 2.6.18 kernel.]]></description>
			<content:encoded><![CDATA[<p>Juergen, Im using the linux-2.6.11 kernel and hence i need to fix the jiffies problem in it. It would be helpful if ill get a patch for only the jiffies problem because i dont want to get into backporting the ipt_recent.c code from 2.6.18 kernel.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17856</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Fri, 13 Oct 2006 13:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17856</guid>

					<description><![CDATA[Manj, please note that the problem is fixed in current Linux kernels.

The test case for the problem actually is pretty simple, just write a ipt_recent rule that blocks after receiving a specific number of packets within 60 seconds on some port. The first jiffies rollover happens five minutes after booting, so there&#039;s enough time to recreate the described problem by telnetting to the port. With a broken version of ipt_recent, the rule will hit after receiving the first packet. With a fixed version it won&#039;t hit until the number of packets you&#039;ve specified is reached.]]></description>
			<content:encoded><![CDATA[<p>Manj, please note that the problem is fixed in current Linux kernels.</p>
<p>The test case for the problem actually is pretty simple, just write a ipt_recent rule that blocks after receiving a specific number of packets within 60 seconds on some port. The first jiffies rollover happens five minutes after booting, so there&#8217;s enough time to recreate the described problem by telnetting to the port. With a broken version of ipt_recent, the rule will hit after receiving the first packet. With a fixed version it won&#8217;t hit until the number of packets you&#8217;ve specified is reached.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Manj		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-17853</link>

		<dc:creator><![CDATA[Manj]]></dc:creator>
		<pubDate>Fri, 13 Oct 2006 13:16:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-17853</guid>

					<description><![CDATA[There is no test case or a proof of concept for the ipt_recent fix
to show the effect of the jiffies changes done in the patch.

It will be useful to accept the patch if any one can provide a
testcase.]]></description>
			<content:encoded><![CDATA[<p>There is no test case or a proof of concept for the ipt_recent fix<br />
to show the effect of the jiffies changes done in the patch.</p>
<p>It will be useful to accept the patch if any one can provide a<br />
testcase.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Moritz		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-15763</link>

		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Thu, 21 Sep 2006 23:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-15763</guid>

					<description><![CDATA[Just to complete this story:

http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.18

commit 404bdbfd242cb99ca0e9d3eb5fbb5bcd54123081
Author: Patrick McHardy 
Date:   Mon May 29 18:21:34 2006 -0700

    [NETFILTER]: recent match: replace by rewritten version
    
    Replace the unmaintainable ipt_recent match by a rewritten version that
    should be fully compatible.]]></description>
			<content:encoded><![CDATA[<p>Just to complete this story:</p>
<p><a href="http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.18" rel="nofollow ugc">http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.18</a></p>
<p>commit 404bdbfd242cb99ca0e9d3eb5fbb5bcd54123081<br />
Author: Patrick McHardy<br />
Date:   Mon May 29 18:21:34 2006 -0700</p>
<p>    [NETFILTER]: recent match: replace by rewritten version</p>
<p>    Replace the unmaintainable ipt_recent match by a rewritten version that<br />
    should be fully compatible.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-8147</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Mon, 10 Jul 2006 21:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-8147</guid>

					<description><![CDATA[Moritz, Patrick McHardy already did a &lt;a href=&quot;http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=61a2139f9cfd24f5b138b5cbacfe526b3e4fec0f;hb=e2b209509ca33743864846aef2e1b2afc21f7915;f=net/ipv4/netfilter/ipt_recent.c&quot; rel=&quot;nofollow&quot;&gt;rewrite&lt;/a&gt; for the forthcoming 2.6.18.]]></description>
			<content:encoded><![CDATA[<p>Moritz, Patrick McHardy already did a <a href="http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=61a2139f9cfd24f5b138b5cbacfe526b3e4fec0f;hb=e2b209509ca33743864846aef2e1b2afc21f7915;f=net/ipv4/netfilter/ipt_recent.c" rel="nofollow">rewrite</a> for the forthcoming 2.6.18.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Moritz		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-7982</link>

		<dc:creator><![CDATA[Moritz]]></dc:creator>
		<pubDate>Sun, 09 Jul 2006 01:59:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-7982</guid>

					<description><![CDATA[Several people seem to suggest that the code would need cleanup/partial rewrite to be maintainable. But, in my opinion, it would really be very nice to have this functionality on the firewall level (even though others seem to think completely different about this).

Jürgen, do you think you will take on this at some point? Or do you consider this module a lost case?]]></description>
			<content:encoded><![CDATA[<p>Several people seem to suggest that the code would need cleanup/partial rewrite to be maintainable. But, in my opinion, it would really be very nice to have this functionality on the firewall level (even though others seem to think completely different about this).</p>
<p>Jürgen, do you think you will take on this at some point? Or do you consider this module a lost case?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sam Liddicott		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-2551</link>

		<dc:creator><![CDATA[Sam Liddicott]]></dc:creator>
		<pubDate>Mon, 08 May 2006 08:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-2551</guid>

					<description><![CDATA[I make mention of this patches and enhancements here so that they do not get lost.

http://article.gmane.org/gmane.comp.security.firewalls.netfilter.devel/14931/match=ipt+recent

Sam]]></description>
			<content:encoded><![CDATA[<p>I make mention of this patches and enhancements here so that they do not get lost.</p>
<p><a href="http://article.gmane.org/gmane.comp.security.firewalls.netfilter.devel/14931/match=ipt+recent" rel="nofollow ugc">http://article.gmane.org/gmane.comp.security.firewalls.netfilter.devel/14931/match=ipt+recent</a></p>
<p>Sam</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-289</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Wed, 21 Dec 2005 02:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-289</guid>

					<description><![CDATA[Yes, the code wasn&#039;t 64-bit safe until 2.6.12.]]></description>
			<content:encoded><![CDATA[<p>Yes, the code wasn&#8217;t 64-bit safe until 2.6.12.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: HansHonk		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-287</link>

		<dc:creator><![CDATA[HansHonk]]></dc:creator>
		<pubDate>Tue, 20 Dec 2005 12:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-287</guid>

					<description><![CDATA[Does CAN-2005-2872 also affected 2.4 based kernels ? At least the following Debian Advisory says so:
http://www.debian.org/security/2005/dsa-921]]></description>
			<content:encoded><![CDATA[<p>Does CAN-2005-2872 also affected 2.4 based kernels ? At least the following Debian Advisory says so:<br />
<a href="http://www.debian.org/security/2005/dsa-921" rel="nofollow ugc">http://www.debian.org/security/2005/dsa-921</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: FX		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-267</link>

		<dc:creator><![CDATA[FX]]></dc:creator>
		<pubDate>Mon, 12 Dec 2005 02:13:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-267</guid>

					<description><![CDATA[Here is another person&#039;s approach to fixing this problem:

http://www.kd.cz/~martin/kernel-recent/readme

These are his patches using 64 bit counters for kernels 2.6.9 and 2.6.14:

http://www.kd.cz/~martin/kernel-recent/

Claims to have worked well on 2.6.9 since February 2005.]]></description>
			<content:encoded><![CDATA[<p>Here is another person&#8217;s approach to fixing this problem:</p>
<p><a href="http://www.kd.cz/~martin/kernel-recent/readme" rel="nofollow ugc">http://www.kd.cz/~martin/kernel-recent/readme</a></p>
<p>These are his patches using 64 bit counters for kernels 2.6.9 and 2.6.14:</p>
<p><a href="http://www.kd.cz/~martin/kernel-recent/" rel="nofollow ugc">http://www.kd.cz/~martin/kernel-recent/</a></p>
<p>Claims to have worked well on 2.6.9 since February 2005.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: micah		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-264</link>

		<dc:creator><![CDATA[micah]]></dc:creator>
		<pubDate>Fri, 09 Dec 2005 22:52:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-264</guid>

					<description><![CDATA[The netfilter team is looking for a maintainer for ipt_recent, if someone doesn&#039;t maintain it, they intend to mark it EXPERIMENTAL or BROKEN in Kconfig 2.6.16: http://lists.netfilter.org/pipermail/netfilter-devel/2005-December/022696.html

Juergen, would you consider maintaining it? You seem to have a very good grasp of the issues.]]></description>
			<content:encoded><![CDATA[<p>The netfilter team is looking for a maintainer for ipt_recent, if someone doesn&#8217;t maintain it, they intend to mark it EXPERIMENTAL or BROKEN in Kconfig 2.6.16: <a href="http://lists.netfilter.org/pipermail/netfilter-devel/2005-December/022696.html" rel="nofollow ugc">http://lists.netfilter.org/pipermail/netfilter-devel/2005-December/022696.html</a></p>
<p>Juergen, would you consider maintaining it? You seem to have a very good grasp of the issues.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-263</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Fri, 09 Dec 2005 20:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-263</guid>

					<description><![CDATA[The value depends on the kernel: Older kernels used 100 on x86, more recent kernels used 1000 and since a few versions you can choose between 100, 250, and 1000 while configuring the kernel.]]></description>
			<content:encoded><![CDATA[<p>The value depends on the kernel: Older kernels used 100 on x86, more recent kernels used 1000 and since a few versions you can choose between 100, 250, and 1000 while configuring the kernel.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: FX		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-262</link>

		<dc:creator><![CDATA[FX]]></dc:creator>
		<pubDate>Fri, 09 Dec 2005 19:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-262</guid>

					<description><![CDATA[By HZ, do you mean interrupt frequency of the timer?  

For example, on a 3.0Ghz cpu with 100 interrupts per sec. for the timer, the correct value is 100, correct?  Jiffies appear to get incremented 100 times per second.]]></description>
			<content:encoded><![CDATA[<p>By HZ, do you mean interrupt frequency of the timer?  </p>
<p>For example, on a 3.0Ghz cpu with 100 interrupts per sec. for the timer, the correct value is 100, correct?  Jiffies appear to get incremented 100 times per second.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-260</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Thu, 08 Dec 2005 01:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-260</guid>

					<description><![CDATA[Each per-IP entry in a ipt_recent list has &lt;code&gt;ip_pkt_list_tot&lt;/code&gt; slots (default is 256) for recording the time of arrival of last seen packets.  The slots are initialized with time &lt;code&gt;0&lt;/code&gt;, ie. an empty slot is a slot which doesn&#039;t record the time of arrival of any packet.

The proc interface for ipt_recent just shows non-empty slots (ie. only slots with value different from zero) but the hit-count calculation looks at all slots unconditionally.  The hit-count algorithm compares the stored time with current jiffies using &lt;code&gt;time_before_eq()&lt;/code&gt;.  &lt;code&gt;time_before_eq(ul, 0UL)&lt;/code&gt; returns true for &lt;code&gt;ul&lt;/code&gt; values greater than &lt;code&gt;LONG_MAX + 1&lt;/code&gt;.

For ipt_recent&#039;s hit-count algorithm this means, that as soon as jiffies (plus the time value given in the rule) reaches &lt;code&gt;LONG_MAX + 2&lt;/code&gt; every empty slot counts as a hit!]]></description>
			<content:encoded><![CDATA[<p>Each per-IP entry in a ipt_recent list has <code>ip_pkt_list_tot</code> slots (default is 256) for recording the time of arrival of last seen packets.  The slots are initialized with time <code>0</code>, ie. an empty slot is a slot which doesn&#8217;t record the time of arrival of any packet.</p>
<p>The proc interface for ipt_recent just shows non-empty slots (ie. only slots with value different from zero) but the hit-count calculation looks at all slots unconditionally.  The hit-count algorithm compares the stored time with current jiffies using <code>time_before_eq()</code>.  <code>time_before_eq(ul, 0UL)</code> returns true for <code>ul</code> values greater than <code>LONG_MAX + 1</code>.</p>
<p>For ipt_recent&#8217;s hit-count algorithm this means, that as soon as jiffies (plus the time value given in the rule) reaches <code>LONG_MAX + 2</code> every empty slot counts as a hit!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: FX		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-259</link>

		<dc:creator><![CDATA[FX]]></dc:creator>
		<pubDate>Wed, 07 Dec 2005 17:30:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-259</guid>

					<description><![CDATA[Thanks so much for the extra info! It was very helpful.

What are empty slots and how do we detect them?]]></description>
			<content:encoded><![CDATA[<p>Thanks so much for the extra info! It was very helpful.</p>
<p>What are empty slots and how do we detect them?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-258</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Tue, 06 Dec 2005 22:43:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-258</guid>

					<description><![CDATA[Hm, I don&#039;t think that that will work because the jiffies rollover isn&#039;t the problem, it&#039;s the difference between current jiffies and last_seen. That would be fixable with slight modifications to your script. But then there&#039;s still the problem with empty slots when jiffies &gt; &lt;code&gt;LONG_MAX&lt;/code&gt;.]]></description>
			<content:encoded><![CDATA[<p>Hm, I don&#8217;t think that that will work because the jiffies rollover isn&#8217;t the problem, it&#8217;s the difference between current jiffies and last_seen. That would be fixable with slight modifications to your script. But then there&#8217;s still the problem with empty slots when jiffies > <code>LONG_MAX</code>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: FX		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-257</link>

		<dc:creator><![CDATA[FX]]></dc:creator>
		<pubDate>Tue, 06 Dec 2005 22:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-257</guid>

					<description><![CDATA[I think I have a workaround for this problem.  Please let me know if this would work:

hourly cron script to cleanup SSHA file in ipt_recent (script pseudocode):

&lt;pre&gt;
get current jiffies by parsing /proc/interrupts
if jiffies close to rollover then
   issue iptables commands to wipe out entries in /proc/net/ipt_recent
else
  for each entry in /proc/net/ipt_recent/SSHA
   age = current jiffies - last_seen
   if age &#062; MAX_AGE
       issue iptables commands to clear this entry from ipt_recent/SSHA
   endif
  endfor 
endif
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>I think I have a workaround for this problem.  Please let me know if this would work:</p>
<p>hourly cron script to cleanup SSHA file in ipt_recent (script pseudocode):</p>
<pre>
get current jiffies by parsing /proc/interrupts
if jiffies close to rollover then
   issue iptables commands to wipe out entries in /proc/net/ipt_recent
else
  for each entry in /proc/net/ipt_recent/SSHA
   age = current jiffies - last_seen
   if age &gt; MAX_AGE
       issue iptables commands to clear this entry from ipt_recent/SSHA
   endif
  endfor 
endif
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-256</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Tue, 06 Dec 2005 21:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-256</guid>

					<description><![CDATA[Sure. Jiffies are an unsigned long value. That means it&#039;s a 32-bit integer on 32-bit Linux architectures and a 64-bit integer on 64-bit Linux architectures.

The kernel initializes jiffies to a value that makes the first rollover happen 5 minutes after boot. This is done to catch rollover problems.

After that, rollovers happen all &lt;code&gt;ULONG_MAX / HZ&lt;/code&gt; seconds.

The ipt_recent problem shows up earlier: It happens after &lt;code&gt;LONG_MAX / HZ&lt;/code&gt; seconds.  E.g., on a 32-bit system with &lt;code&gt;HZ=1000&lt;/code&gt; that means after (2³¹-1)s/1000 = 2147483.647s &#8776; 24.855 days.

On 64-bit systems you&#039;re safe. On 32-bit kernels you can either use a kernel with a lower &lt;code&gt;HZ&lt;/code&gt; setting (e.g. 100 or 250, which gives you about 249 or 99 days before getting problems) or use my patch (I really should upload an updated version).]]></description>
			<content:encoded><![CDATA[<p>Sure. Jiffies are an unsigned long value. That means it&#8217;s a 32-bit integer on 32-bit Linux architectures and a 64-bit integer on 64-bit Linux architectures.</p>
<p>The kernel initializes jiffies to a value that makes the first rollover happen 5 minutes after boot. This is done to catch rollover problems.</p>
<p>After that, rollovers happen all <code>ULONG_MAX / HZ</code> seconds.</p>
<p>The ipt_recent problem shows up earlier: It happens after <code>LONG_MAX / HZ</code> seconds.  E.g., on a 32-bit system with <code>HZ=1000</code> that means after (2³¹-1)s/1000 = 2147483.647s &asymp; 24.855 days.</p>
<p>On 64-bit systems you&#8217;re safe. On 32-bit kernels you can either use a kernel with a lower <code>HZ</code> setting (e.g. 100 or 250, which gives you about 249 or 99 days before getting problems) or use my patch (I really should upload an updated version).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: FX		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-255</link>

		<dc:creator><![CDATA[FX]]></dc:creator>
		<pubDate>Tue, 06 Dec 2005 19:46:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-255</guid>

					<description><![CDATA[Thanks so much for writing about this!

Is the time required for the jiffies rollover predictable?

Would rebooting the server once per week avoid this problem?]]></description>
			<content:encoded><![CDATA[<p>Thanks so much for writing about this!</p>
<p>Is the time required for the jiffies rollover predictable?</p>
<p>Would rebooting the server once per week avoid this problem?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: micah		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-130</link>

		<dc:creator><![CDATA[micah]]></dc:creator>
		<pubDate>Thu, 20 Oct 2005 14:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-130</guid>

					<description><![CDATA[I think I&#039;ve noticed this problem -- I&#039;ve found myself blacklisted even when only issuing one ssh connection. I&#039;ve even been blacklisted when already connected via ssh.]]></description>
			<content:encoded><![CDATA[<p>I think I&#8217;ve noticed this problem &#8212; I&#8217;ve found myself blacklisted even when only issuing one ssh connection. I&#8217;ve even been blacklisted when already connected via ssh.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Juergen Kreileder		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-102</link>

		<dc:creator><![CDATA[Juergen Kreileder]]></dc:creator>
		<pubDate>Sat, 08 Oct 2005 21:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-102</guid>

					<description><![CDATA[The situation hasn&#039;t changed.

I&#039;ll post an updated patch for just the jiffies problem in the next days. And, maybe, I&#039;ll start a rewrite when I have some free days.]]></description>
			<content:encoded><![CDATA[<p>The situation hasn&#8217;t changed.</p>
<p>I&#8217;ll post an updated patch for just the jiffies problem in the next days. And, maybe, I&#8217;ll start a rewrite when I have some free days.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: micah		</title>
		<link>/articles/fixing-the-ipt_recent-netfilter-module/comment-page-1/#comment-101</link>

		<dc:creator><![CDATA[micah]]></dc:creator>
		<pubDate>Sat, 08 Oct 2005 21:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.blackdown.de/2005/05/09/fixing-the-ipt_recent-netfilter-module/#comment-101</guid>

					<description><![CDATA[CAN-2005-2802 has been rejected, its only CAN-2005-2872 and CAN-2005-2873.

Is there an update to this? It seems like Dave Miller didn&#039;t like the proposed fix, and thinks that the only solution is a complete rewrite of ipt_recent? This is somewhat annoying because this seemed like the best solution to this problem I&#039;ve seen so far, and to find that the kernel needs a module re-written before this can be useful is disheartening.]]></description>
			<content:encoded><![CDATA[<p>CAN-2005-2802 has been rejected, its only CAN-2005-2872 and CAN-2005-2873.</p>
<p>Is there an update to this? It seems like Dave Miller didn&#8217;t like the proposed fix, and thinks that the only solution is a complete rewrite of ipt_recent? This is somewhat annoying because this seemed like the best solution to this problem I&#8217;ve seen so far, and to find that the kernel needs a module re-written before this can be useful is disheartening.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
