From: Anders Franzen <anders.franzen@ericsson.com>
To: <kaber@trash.net>
Cc: <netdev@vger.kernel.org>, <eric.dumazet@gmail.com>,
<davem@davemloft.net>,
Anders Franzen <anders.franzen@ericsson.com>
Subject: [PATCH] the macvlan device causes SLAB corruption on network namespace exit.
Date: Wed, 24 Nov 2010 16:35:41 +0100 [thread overview]
Message-ID: <1290612941-8417-1-git-send-email-anders.franzen@ericsson.com> (raw)
When doing exit from a network namespace, cleanup functions are executed from
the function default_device_exit_batch.
In the macvlan device, this will generate a call to macvlan_dellink.
If it is the last macvlan using a ''lowerdev'' the port is
destroyed.
Later the a call to macvlan_stop is executed. when the macvlan_hash_del(vlan) is
executed, the memory of the already freed port will be corrupted.
Signed-off-by: Anders Franzen <anders.franzen@ericsson.com>
---
drivers/net/macvlan.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6ed577b..c1cddb6 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -338,7 +338,9 @@ static int macvlan_stop(struct net_device *dev)
dev_uc_del(lowerdev, dev->dev_addr);
hash_del:
- macvlan_hash_del(vlan);
+ if (macvlan_port_exists(lowerdev))
+ macvlan_hash_del(vlan);
+
return 0;
}
--
1.7.2.3
reply other threads:[~2010-11-24 15:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1290612941-8417-1-git-send-email-anders.franzen@ericsson.com \
--to=anders.franzen@ericsson.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kaber@trash.net \
--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).