: Fix memleak on device removal/crash on module removal
Subsystems (2)
commit 2fe876e51d1f053b55d8d50c3733b136b6add016
Author: Patrick McHardy <[email protected]> Date: Wed May 7 09:43:05 2008 +0200
[MACVLAN]: Fix memleak on device removal/crash on module removal
As noticed by Ben Greear, macvlan crashes the kernel when unloading the module. The reason is that it tries to clean up the macvlan_port pointer on the macvlan device itself instead of the underlying device. A non-NULL pointer is taken as indication that the macvlan_handle_frame_hook is valid, when receiving the next packet on the underlying device it tries to call the NULL hook and crashes.
Clean up the macvlan_port on the correct device to fix this.
Signed-off-by; Patrick McHardy <[email protected]>
drivers/net/macvlan.c +1 -1
@@ -450,7 +450,7 @@ static void macvlan_dellink(struct net_device *dev)unregister_netdevice (dev);if (list_empty (&port->vlans)) -macvlan_port_destroy (dev); +macvlan_port_destroy (port->dev); }static struct rtnl_link_ops macvlan_link_ops__read_mostly = {
Quoted 8 lines · Patrick McHardy
------------------------------------------------------------------------
commit
2fe876e51d1f053b55d8d50c3733b136b6add016Author: Patrick McHardy <[email protected]> Date: Wed May 7 09:43:05 2008 +0200[MACVLAN]: Fix memleak on device removal/crash on module removal
Thanks. I just tested this on 2.6.23 and it seems to fix the crash.
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
David Miller
maintainerFrom: Ben Greear <[email protected]>
Date: Wed, 07 May 2008 15:03:19 -0700
Quoted 11 lines
Quoted 8 lines · Patrick McHardy
------------------------------------------------------------------------
commit
2fe876e51d1f053b55d8d50c3733b136b6add016Author: Patrick McHardy <[email protected]> Date: Wed May 7 09:43:05 2008 +0200[MACVLAN]: Fix memleak on device removal/crash on module removal
Thanks. I just tested this on 2.6.23 and it seems to fix the crash.
Thanks for testing Ben.
David Miller
maintainerFrom: Ben Greear <[email protected]>
Date: Wed, 07 May 2008 15:03:19 -0700
Quoted 11 lines
Quoted 8 lines · Patrick McHardy
------------------------------------------------------------------------
commit
2fe876e51d1f053b55d8d50c3733b136b6add016Author: Patrick McHardy <[email protected]> Date: Wed May 7 09:43:05 2008 +0200[MACVLAN]: Fix memleak on device removal/crash on module removal
Thanks. I just tested this on 2.6.23 and it seems to fix the crash.
I've applied this to net-2.6, and will queue it up for net-2.6 as well.
Thanks again!
Quoted 14 lines · David Miller
From: Ben Greear <[email protected]>
Date: Wed, 07 May 2008 15:03:19 -0700Quoted 10 lines
Quoted 8 lines · Patrick McHardy
------------------------------------------------------------------------
commit
2fe876e51d1f053b55d8d50c3733b136b6add016Author: Patrick McHardy <[email protected]> Date: Wed May 7 09:43:05 2008 +0200[MACVLAN]: Fix memleak on device removal/crash on module removal
Quoted 8 lines
Quoted 2 lines
Thanks. I just tested this on 2.6.23 and it seems to fix the crash.
I've applied this to net-2.6, and will queue it up for net-2.6 as well.
Thanks again!
This might be worth adding to any/all 2.6.23+ stable series since it's a reliable kernel crash on module unload.
I'm not sure if anyone else is really using mac-vlans much yet though...
Thanks,
Ben
Signature · 1 line
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 5 lines · Ben Greear
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
[MACVLAN]: Fix memleak on device removal/crash on module removal
Thanks. I just tested this on 2.6.23 and it seems to fix the crash.
Quoted 7 lines
Quoted 5 lines
I've applied this to net-2.6, and will queue it up for net-2.6 as well.
Thanks again!
This might be worth adding to any/all 2.6.23+ stable series since it's a reliable kernel crash on module unload.
I don't think there is anyone maintaining the stable kernels before stable-2.6.25 (for which I think Dave already queued it up, above appears to be a typo).
Quoted 1 line
I'm not sure if anyone else is really using mac-vlans much yet though...
I know of a few users, but not too many I guess. The fix is obvious though so it doesn't hurt for -stable in any case.