netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip_gre.c in 2.6.0-test5
@ 2003-09-24  8:34 Michal Ludvig
  2003-09-25 10:56 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Ludvig @ 2003-09-24  8:34 UTC (permalink / raw)
  To: netdev

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

Hi all,
this trivial patch fixes possible kernel crash when using GRE tunnels in 
2.6.0-test. The problem was that "dev->init" wasn't set before 
register_netdevice() call and so the initialization function was never 
called. Consequently some fields in the tunnel structure were not 
initialized what finally led to a kernel crash upon receiving the first 
packet over the GRE tunnel.

Michal Ludvig
-- 
* A mouse is a device used to point at the xterm you want to type in.
* Personal homepage - http://www.logix.cz/~mic

[-- Attachment #2: kernel-ip_gre-1.diff --]
[-- Type: text/plain, Size: 642 bytes --]

# Patch for http://bugme.osdl.org/show_bug.cgi?id=1130 
# Applies cleanly to 2.6.0-test5
# Michal Ludvig <mludvig@suse.cz>
--- linux-2.6.0-test5-clean/net/ipv4/ip_gre.c	2003-09-08 21:50:18.000000000 +0200
+++ linux-2.6.0-test5/net/ipv4/ip_gre.c	2003-09-23 16:50:09.000000000 +0200
@@ -271,13 +271,17 @@ static struct ip_tunnel * ipgre_tunnel_l
 	}
 
 	dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
+	if (!dev)
+	  return NULL;
+
+	dev->init = ipgre_tunnel_init;
+
 	if (register_netdevice(dev) < 0) {
 		kfree(dev);
 		goto failed;
 	}
 
 	nt = dev->priv;
-	dev->init = ipgre_tunnel_init;
 	nt->parms = *parms;
 
 	dev_hold(dev);

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

* Re: [PATCH] ip_gre.c in 2.6.0-test5
  2003-09-24  8:34 [PATCH] ip_gre.c in 2.6.0-test5 Michal Ludvig
@ 2003-09-25 10:56 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-09-25 10:56 UTC (permalink / raw)
  To: Michal Ludvig; +Cc: netdev

On Wed, 24 Sep 2003 10:34:58 +0200
Michal Ludvig <michal@logix.cz> wrote:

> this trivial patch fixes possible kernel crash when using GRE tunnels in 
> 2.6.0-test. The problem was that "dev->init" wasn't set before 
> register_netdevice() call and so the initialization function was never 
> called. Consequently some fields in the tunnel structure were not 
> initialized what finally led to a kernel crash upon receiving the first 
> packet over the GRE tunnel.

Applied, thanks Michal.

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

end of thread, other threads:[~2003-09-25 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-24  8:34 [PATCH] ip_gre.c in 2.6.0-test5 Michal Ludvig
2003-09-25 10:56 ` David S. Miller

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).