Bug 152792 - Kernel panic when reading /proc/net/ip_conntrack
Kernel panic when reading /proc/net/ip_conntrack
Status: CLOSED DEFERRED
Product: Fedora Legacy
Classification: Retired
Component: kernel (Show other bugs)
rhl9
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Fedora Legacy Bugs
https://bugzilla.netfilter.org/bugzil...
LEGACY, DEFER
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-01 17:47 EDT by Craig
Modified: 2007-04-18 13:22 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-13 09:12:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description David Lawrence 2005-03-30 18:27:37 EST
Hello,

Running less /proc/net/ip_conntrack will often cause my kernel to panic. I'm
running RH9, kernel 2.4.20-8 (I haven't upgraded to RH's last 2.4.20-31.9 kernel
or your 2.4.20-37.9 kernel because the RPM changelogs didn't say anything about
this bug).

Looking around on the web it seems this problem is known:
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=131
And a patch which affects the destroy_conntrack function in
net/ipv4/netfilter/ip_conntrack_core.c was released against the 2.4.26 kernel. 

I'd patch this myself but destroy_conntrack was different in 2.4.20-8! Can this
change be rolled into the 2.4.20-x legacy kernel series?

Thanks!



------- Additional Comments From dom@earth.li 2004-10-18 01:33:00 ----

Hi,

The patch URL 404s.



------- Additional Comments From craig@darkcalgary.com 2004-10-18 07:49:08 ----

Must be a temporary 404. The whole netfilter bugzilla site is 404 not found (try
the Bugzilla link from http://www.netfilter.org/ )

There are patches by Harald Welte at the bottom of this bug entry at osdl.org:
http://bugme.osdl.org/show_bug.cgi?id=1764




------- Additional Comments From jpdalbec@ysu.edu 2004-11-23 04:40:59 ----

Summarizing the links posted:

Patch #1:

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/05/27 02:01:28+02:00 kaber@trash.net 
#   [NETFILTER]: Don't assign new helper after NAT when there are already
expectations present
# 
# net/ipv4/netfilter/ip_conntrack_core.c
#   2004/05/27 02:01:19+02:00 kaber@trash.net +2 -4
#   [NETFILTER]: Don't assign new helper after NAT when there are already
expectations present
# 
diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c
b/net/ipv4/netfilter/ip_conntrack_core.c
--- a/net/ipv4/netfilter/ip_conntrack_core.c	2004-05-27 02:03:11 +02:00
+++ b/net/ipv4/netfilter/ip_conntrack_core.c	2004-05-27 02:03:11 +02:00
@@ -1127,10 +1127,8 @@
 	DUMP_TUPLE(newreply);
 
 	conntrack->tuplehash[IP_CT_DIR_REPLY].tuple = *newreply;
-	if (!conntrack->master)
-		conntrack->helper = LIST_FIND(&helpers, helper_cmp,
-					      struct ip_conntrack_helper *,
-					      newreply);
+	if (!conntrack->master && list_empty(&conntrack->sibling_list))
+		conntrack->helper = ip_ct_find_helper(newreply);
 	WRITE_UNLOCK(&ip_conntrack_lock);
 
 	return 1;

Patch #2 (two versions):

Version 1 (committed to CVS):

===== net/ipv4/netfilter/ip_conntrack_core.c 1.45 vs edited =====
--- 1.45/net/ipv4/netfilter/ip_conntrack_core.c	Tue Mar 30 06:24:39 2004
+++ edited/net/ipv4/netfilter/ip_conntrack_core.c	Sun Apr 25 02:10:39 2004
@@ -324,8 +324,9 @@
 		ip_conntrack_destroyed(ct);
 
 	WRITE_LOCK(&ip_conntrack_lock);
-	/* Delete us from our own list to prevent corruption later */
-	list_del(&ct->sibling_list);
+	/* Make sure don't leave any orphaned expectations lying around */
+	if (ct->expecting)
+		remove_expectations(ct, 1);
 
 	/* Delete our master expectation */
 	if (ct->master) {

--- or ---

Version 2 (original patch posted by Phil Oester):

diff -ru linux-2.4.26/net/ipv4/netfilter/ip_conntrack_core.c
linux-2.4.26-po/net/ipv4/netfilter/ip_conntrack_core.c
--- linux-2.4.26/net/ipv4/netfilter/ip_conntrack_core.c 2004-02-18
08:36:32.000000000 -0500
+++ linux-2.4.26-po/net/ipv4/netfilter/ip_conntrack_core.c      2004-04-17
15:27:50.884612424 -0400
@@ -326,6 +322,11 @@
                ip_conntrack_destroyed(ct);
 
        WRITE_LOCK(&ip_conntrack_lock);
+
+       /* Make sure we don't leave any orphaned expectations lying around */
+       if (ct->expecting)
+               remove_expectations(ct,1);
+
        /* Delete us from our own list to prevent corruption later */
        list_del(&ct->sibling_list);
 



------- Additional Comments From jpdalbec@ysu.edu 2004-11-24 03:47:03 ----

Apparently version 1 of patch #2 is OK:

> By calling remove_expectations(ct, 1) all siblings are already removed from
> the list, so the list_del is not necessary anymore.
> 
> Regards
> Patrick 



------- Bug moved to this database by dkl@redhat.com 2005-03-30 18:27 -------

This bug previously known as bug 2106 at https://bugzilla.fedora.us/
https://bugzilla.fedora.us/show_bug.cgi?id=2106
Originally filed under the Fedora Legacy product and Package request component.

Unknown priority P2. Setting to default priority "normal".
Unknown platform PC. Setting to default platform "All".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Pekka Savola 2005-11-16 08:19:53 EST
This doesn't seem to be important enough to fix just on its own, so mark it DEFER.
Comment 2 Craig 2005-11-16 13:09:10 EST
Hey, thanks for the insight, Pekka. Who would ever want to read
/proc/net/ip_conntrack anyway, right?

I figured out about 10 months ago that this would never get fixed, so I upgraded
to 2.4.27 from source.

Note You need to log in before you can comment on or make changes to this bug.