netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karlis Peisenieks <karlis@mt.lv>
To: netdev@oss.sgi.com
Subject: ip multicast bug
Date: Tue, 17 Feb 2004 17:55:16 +0200	[thread overview]
Message-ID: <20040217155516.GA20477@mt.lv> (raw)

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

Hello,

Patch below fixes kernel crash when multicast group is joined on 
disabled interface with IP address added.

The problem is 
ip_mc_join_group->ip_mc_inc_group->igmp_group_added
->igmp_ifc_event->igmp_ifc_start_timer which does mod_timer on 
uninitialized timer_struct (mr_ifc_timer). As soon as timer fires, 
kernel crashes.

Multicast related fields of in_device are only initialized in ip_mc_up
which gets called when device is enabled.

Perhaps somebody with more clue on multicast implementation can comment 
on this fix - is this fix enough or maybe wrong.


Karlis

[-- Attachment #2: igmp.c.patch --]
[-- Type: text/plain, Size: 496 bytes --]

--- igmp.c	2 Dec 2003 08:53:00 -0000	1.1.1.7
+++ igmp.c	17 Feb 2004 15:51:58 -0000
@@ -1151,12 +1151,14 @@
 	im->next=in_dev->mc_list;
 	in_dev->mc_list=im;
 	write_unlock_bh(&in_dev->lock);
+
+	if (in_dev->dev->flags & IFF_UP) {
 #ifdef CONFIG_IP_MULTICAST
-	igmpv3_del_delrec(in_dev, im->multiaddr);
+		igmpv3_del_delrec(in_dev, im->multiaddr);
 #endif
-	igmp_group_added(im);
-	if (in_dev->dev->flags & IFF_UP)
+		igmp_group_added(im);
 		ip_rt_multicast_event(in_dev);
+	}
 out:
 	return;
 }

             reply	other threads:[~2004-02-17 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-17 15:55 Karlis Peisenieks [this message]
2004-02-17 20:10 ` ip multicast bug David Stevens
2004-02-17 21:50 ` David Stevens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040217155516.GA20477@mt.lv \
    --to=karlis@mt.lv \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).