All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] h323 module unloading fix
@ 2005-02-08 14:59 Harald Welte
  2005-02-08 15:26 ` Max Kellermann
  2005-02-08 23:10 ` Patrick McHardy
  0 siblings, 2 replies; 11+ messages in thread
From: Harald Welte @ 2005-02-08 14:59 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Jozsef Kadlecsik


[-- Attachment #1.1: Type: text/plain, Size: 1049 bytes --]

Hi!

If you unload the ip_conntrack_h323 module while a h323 session is in
progress, the conntrack table is left with corrupted entries (->helper
pointer still pointing to a now no longer existing h245 helper).

This is because the h245 helper is not registered with the core, and
therefore the helper_unregister() function will only be called for h245,
but not for h245.

The proposed solution:

1) to make ip_conntrack_core:ip_conntrack_helper_unregister() work with
   a helper that was never registered (and thus has an empty list.next)
2) to have ip_conntrack_h323 unregister the h245 helper.

Any comments?

Patches for h323(pom) and 2.4.29 attached.

-- 
- Harald Welte <laforge@netfilter.org>             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

[-- Attachment #1.2: patch-2.4.29-h323-h245-unregister.patch --]
[-- Type: text/plain, Size: 586 bytes --]

--- a/net/ipv4/netfilter/ip_conntrack_core.c	2005-02-08 15:26:57.000000000 +0100
+++ b/net/ipv4/netfilter/ip_conntrack_core.c	2005-02-08 15:27:36.000000000 +0100
@@ -1149,7 +1149,11 @@
 
 	/* Need write lock here, to delete helper. */
 	WRITE_LOCK(&ip_conntrack_lock);
-	LIST_DELETE(&helpers, me);
+	
+	/* Conditional since some helpers (h245) are not really registered
+	 * and thus don't appear in our global list*/
+	if (me->list.next)
+		LIST_DELETE(&helpers, me);
 
 	/* Get rid of expecteds, set helpers to NULL. */
 	for (i = 0; i < ip_conntrack_htable_size; i++)

[-- Attachment #1.3: f --]
[-- Type: text/plain, Size: 349 bytes --]


--- a/net/ipv4/netfilter/ip_conntrack_h323.c	2005-02-08 15:33:36.000000000 +0100
+++ b/net/ipv4/netfilter/ip_conntrack_h323.c	2005-02-08 15:33:51.000000000 +0100
@@ -300,6 +300,7 @@
 {
 	/* Unregister H.225 helper */	
 	ip_conntrack_helper_unregister(&h225);
+	ip_conntrack_helper_unregister(&h245);
 }
 
 EXPORT_SYMBOL(ip_h323_lock);


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-02-09 13:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-08 14:59 [RFC] h323 module unloading fix Harald Welte
2005-02-08 15:26 ` Max Kellermann
2005-02-08 15:52   ` Harald Welte
2005-02-08 15:55     ` Max Kellermann
2005-02-08 23:10 ` Patrick McHardy
2005-02-09  8:24   ` Harald Welte
2005-02-09  8:59     ` Jozsef Kadlecsik
2005-02-09  9:10       ` Max Kellermann
2005-02-09 10:25         ` Jozsef Kadlecsik
2005-02-09 10:05       ` Harald Welte
2005-02-09 13:34     ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.