From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Cong Wang <cwang@twopensource.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Wengang <wen.gang.wang@oracle.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] bonding: clear header_ops when last slave detached (v2)
Date: Thu, 20 Nov 2014 14:53:05 -0800 [thread overview]
Message-ID: <23563.1416523985@famine> (raw)
In-Reply-To: <CAHA+R7P9XhGQZXFy6frxOyZJ4rX_MdVgY3kAPE1_wDNcvYd_yA@mail.gmail.com>
Cong Wang <cwang@twopensource.com> wrote:
>Also, no one seems to care about my previous question:
>why only bonding has the problem?
Bonding has the problem because it stashes a pointer to a data
structure (the header_ops) from another module, and when that module is
unloaded the dangling pointer may be dereferenced if it's not either
cleared or made to never go away.
Setting the bonding->header_ops to NULL (to avoid the current
problem with pktgen) has a race in dev_hard_header between where the
header_ops pointer is checked and where the ->create function is called.
This pointer business is the main reason the bonding path for
"not ARPHRD_ETHER" (i.e., ipoib) has extra complexity in the open/close
path, e.g.,
bond_slave_netdev_event():
[...]
switch (event) {
case NETDEV_UNREGISTER:
if (bond_dev->type != ARPHRD_ETHER)
bond_release_and_destroy(bond_dev, slave_dev);
else
bond_release(bond_dev, slave_dev);
If the ipoib ops were static in vmlinux, that would resolve the
pktgen problem, and also may eliminate the need for some of the ugly
bits like what I've pasted in above.
-J
---
-Jay Vosburgh, jay.vosburgh@canonical.com
next prev parent reply other threads:[~2014-11-20 22:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 5:18 [PATCH] bonding: clear header_ops when last slave detached (v2) Wengang Wang
2014-11-19 5:22 ` Wengang
2014-11-19 5:39 ` Eric Dumazet
2014-11-19 7:00 ` Wengang
2014-11-19 22:26 ` Cong Wang
2014-11-19 22:56 ` Cong Wang
2014-11-20 6:41 ` Eric Dumazet
2014-11-20 17:34 ` Cong Wang
2014-11-20 20:41 ` Eric Dumazet
2014-11-20 21:57 ` Cong Wang
2014-11-20 22:03 ` Eric Dumazet
2014-11-20 22:13 ` Cong Wang
2014-11-20 22:53 ` Jay Vosburgh [this message]
2014-11-21 18:17 ` Cong Wang
2014-11-21 18:54 ` Jay Vosburgh
2014-11-24 3:05 ` Wengang
2014-11-21 18:55 ` 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=23563.1416523985@famine \
--to=jay.vosburgh@canonical.com \
--cc=cwang@twopensource.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=wen.gang.wang@oracle.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).