From: Jay Vosburgh <fubar@us.ibm.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jgarzik@pobox.com, monis@voltaire.com,
Jay Vosburgh <fubar@us.ibm.com>
Subject: [PATCH] bonding: Fix resource use after free
Date: Mon, 12 Nov 2007 18:15:36 -0800 [thread overview]
Message-ID: <1194920136881-git-send-email-fubar@us.ibm.com> (raw)
Fix bond_destroy and bond_free_all to not reference the
struct net_device after calling unregister_netdevice.
Bug and offending change reported by Moni Shoua <monis@voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
---
Copying DaveM since Jeff is out this week; please apply for 2.6.24.
-J
drivers/net/bonding/bond_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a198404..423298c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1847,9 +1847,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
*/
void bond_destroy(struct bonding *bond)
{
- unregister_netdevice(bond->dev);
bond_deinit(bond->dev);
bond_destroy_sysfs_entry(bond);
+ unregister_netdevice(bond->dev);
}
/*
@@ -4475,8 +4475,8 @@ static void bond_free_all(void)
bond_mc_list_destroy(bond);
/* Release the bonded slaves */
bond_release_all(bond_dev);
- unregister_netdevice(bond_dev);
bond_deinit(bond_dev);
+ unregister_netdevice(bond_dev);
}
#ifdef CONFIG_PROC_FS
--
1.5.3.1
next reply other threads:[~2007-11-13 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-13 2:15 Jay Vosburgh [this message]
2007-11-14 5:16 ` [PATCH] bonding: Fix resource use after free David Miller
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=1194920136881-git-send-email-fubar@us.ibm.com \
--to=fubar@us.ibm.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=monis@voltaire.com \
--cc=netdev@vger.kernel.org \
/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).