PROBLEM: PATCH for 2.4.23-pre4 and up hang on one system
Please have a look, thanks guys.
Begin forwarded message:
Date: Sat, 8 Nov 2003 18:27:28 -1000
From: "Beau E. Cox" <[email protected]>
To: [email protected]
Cc: Marcelo Tosatti <[email protected]>
Subject: PROBLEM: PATCH for 2.4.23-pre4 and up hang on one system
submitted Sat Nov 8 13:08:55 HST 2003 by Beau E. Cox <[email protected]>
[1.] One line summary of the problem:
Patch that fixes my problem:
Starting with 2.4.23-pre4 my system hangs during startup and/or is generally unstable (see patch in [ X. ] below.)
[2.] Full description of the problem/report:
Origionally I had catagorized this problem with the startup sequence; the system always seemed to hang when squid was started before mysql, etc. Moving squid near the end of the startup process, I thought the problem was in hand. However, the system (pre9) proved unstable (would not stay up for longer than one day.)
The problem exhibits itself with a solid 'hang'; no oops, no dumps, nada.
[ 3. ] - [ 7. ]
See previous posting; no hardware or configuration changes.
[X.] Other notes, patches, fixes, workarounds:
This patch to net/ipv4/netfilter/ip_nat_core.c fixed my problem in all 2.4.23 versions pre4 - pre9:
--- linux-2.4.23-pre4/net/ipv4/netfilter/ip_nat_core.c 2003-11-08
03:01:59.000000000 -1000
+++ linux-2.4.23-pre3/net/ipv4/netfilter/ip_nat_core.c 2003-11-08
03:00:47.000000000 -1000
@@ -157,8 +157,8 @@
continue;
}
- if (!(mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED)
- || proto->in_range(&newtuple, IP_NAT_MANIP_SRC,
+ if ((mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED)
+ && proto->in_range(&newtuple, IP_NAT_MANIP_SRC,
&mr->range[i].min, &mr->range[i].max))
return 1;
}
It is simply a rollback of changes to ip_nat_core.c made in pre4.
Since my patch is to ip_nat_core.c, I should mention that I use NAT via iptables. Here is an the relevant section if my iptables startup script:
[...]
# setup nat echo " applying nat rules" echo "" $iptables -F FORWARD $iptables -F -t nat $iptables -P FORWARD DROP $iptables -A FORWARD -i eth0 -j ACCEPT $iptables -A INPUT -i eth0 -j ACCEPT $iptables -A OUTPUT -o eth0 -j ACCEPT $iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT $iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth1 -j SNAT --to-source x.x.x.x [...]
All the information I can think of relating to this problem is at:
ftp://beaucox.com/pub/kernel/2.4.23-pre4-bug
Please see the README file.
---------------------------WARNING-------------------------- I am NOT a kernel programmer. The patch above was arrived at by hit-or-miss. I REALLY don't know what I am doing (but my system works now!) ---------------------------WARNING--------------------------
Aloha => Beau;
PS: Please let me know if you need more information.
Quoted 1 line · David S. Miller
Please have a look, thanks guys.
Thanks, David. Marcelo forwarded that message to the netfilter (non-devel) list, see my reply attached.
I've read and change again and again: The change _is_ correct. Also, it is in effect for quite some time, we have it in CVS/patch-o-matic for more than two months, and lots of people are using patch-o-matic.
I also cannot reproduce the bug here, I'm running quite a lot of post-pre4 systems in such a simple SNAT scenario.
:(
Quoted 1 line
Begin forwarded message:
Signature · 3 lines
- Harald Welte <[email protected]> http://www.gnumonks.org/ ============================================================================ Programming is like sex: One mistake and you have to support it your lifetime
[moving the discussion to [email protected]]
Hi Marcelo and Beau!
Quoted 8 lines
Quoted 8 lines
Origionally I had catagorized this problem with the startup sequence; the system always seemed to hang when squid was started before mysql, etc. Moving squid near the end of the startup process, I thought the problem was in hand. However, the system (pre9) proved unstable (would not stay up for longer than one day.)
The problem exibits itself with a solid 'hang'; no oops, no dumps, nada.
that's really strange. I'd suspect a lot of people are running a recent
Quoted 1 line
= pre5 kernel in a simple SNAT / MASQUERADE scenario, but we haven't
received any bugreports about this so far. It has also been in our CVS repository for two months, and was present in out patch-o-matic release of September 12, 2003. I'm also running a number of 2.4.23-pre7 kernels as firwalls, with no problem.
The particular change between pre3 and pre4 that you reverted was correct.
The in_range() function is supposed to tell the caller whether a specific modified tuple (that is srcip/srcport->dstip/dstport tuple) is within a given NAT range.
The
if (!(mr->range[i].flags & IP_NAT_RANGE_PROTO_SPECIFIED) || proto->in_range(&newtuple, IP_NAT_MANIP_SRC, &mr->range[i].min, &mr->range[i].max)) return 1;
section does (after the modification) exactly what it is supposed to:
- If the range did not contain a per-proto range (i.e. all port numbers are allowed to be used), return '1'
- If the range did contain a per-proto range, call the l3 protocol helper to see whether it is in range. If yes, return 1.
Quoted 3 lines
Since my patch was to
ip_nat_core.c, I should have mentioned that I use NAT via iptables. Here is an the relevant section if my iptables startup script:
Signature · 5 lines
- Harald Welte <[email protected]> http://www.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
Quoted 9 lines · On Tue, 11 Nov 2003 11:43:17 +0100 Harald Welte <[email protected]> wrote:
Quoted 1 line · David S. Miller
Please have a look, thanks guys.
Thanks, David. Marcelo forwarded that message to the netfilter (non-devel) list, see my reply attached.
I've read and change again and again: The change _is_ correct. Also, it is in effect for quite some time, we have it in CVS/patch-o-matic for more than two months, and lots of people are using patch-o-matic.
Ok.
If anything does need to be fixed, just let me know. Even if you haven't coded up a patch yet, but you know the bug, let me know first. This way I can tell Marcelo to hold up while the fix is being worked on.
----- Original Message -----
From: "Harald Welte" <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: "Netfilter Development Mailinglist" <[email protected]>
Sent: Tuesday, November 11, 2003 11:43 AM
Subject: Re: Fw: PROBLEM: PATCH for 2.4.23-pre4 and up hang on one system
Quoted 6 lines · David S. Miller
Quoted 1 line
Please have a look, thanks guys.
Thanks, David. Marcelo forwarded that message to the netfilter (non-devel) list, see my reply attached.
Quoted 6 lines
I've read and change again and again: The change _is_ correct. Also, it is in effect for quite some time, we have it in CVS/patch-o-matic for more than two months, and lots of people are using patch-o-matic.
I also cannot reproduce the bug here, I'm running quite a lot of post-pre4 systems in such a simple SNAT scenario.
Mr Welte, I'd spent the last week debugging a problem in one of my
routers and I can now say that this change has something to do with it. I use a modified 2.4.21 kernel on my routers, it has been running for months without a glitch. The last week I applied some patches from pom so that I can use the connmark and several other new match/targets. I test all the changes in an SMP box and it worked fine, then I installed the kernel on a production box and it started to hang "randomly", from minutes to hours. It is not a hard lockup but a livelock, the box doesn't have network neither userspace but still responds to Alt-SysRq keys. When I saw this bug report I tried reverting only this one patch and it started to work again, the box has been up for 4 days now.
As I said in my development box I was unable to reproduce the lock.
Best regards,
-Jorge
==============================================================
Jorge Boncompte - Tecnico de sistemas
DTI2 - Desarrollo de la Tecnologia de las Comunicaciones
--------------------------------------------------------------
C/ Abogado Enriquez Barrios, 5 14004 CORDOBA (SPAIN)
Tlf: +34 957 761395 / FAX: +34 957 450380
==============================================================
- Sin pistachos no hay Rock & Roll...
- Without wicker a basket cannot be done.
==============================================================