lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 17 Nov 2014 09:19:05 +0800 From: Wengang <wen.gang.wang@...cle.com> To: netdev@...r.kernel.org CC: Wengang Wang <wen.gang.wang@...cle.com> Subject: Re: [PATCH] [bonding]: clear header_ops when last slave detached Hi, Could anybody please review this patch? thanks, wengang 于 2014年11月13日 10:19, Wengang Wang 写道: > When last slave of a bonding master is removed, the bonding then does not work. > When packet_snd is called against with a master net_device, it accesses > header_ops. In case the header_ops is not valid any longer(say module unloaded) > it will then access an invalid memory address. > This patch try to fix this issue by clearing header_ops when last slave > detached. > > Signed-off-by: Wengang Wang <wen.gang.wang@...cle.com> > --- > drivers/net/bonding/bond_main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > index c9ac06c..84a34fc 100644 > --- a/drivers/net/bonding/bond_main.c > +++ b/drivers/net/bonding/bond_main.c > @@ -1728,6 +1728,8 @@ static int __bond_release_one(struct net_device *bond_dev, > unblock_netpoll_tx(); > synchronize_rcu(); > bond->slave_cnt--; > + if (!bond->slave_cnt) > + bond->dev->header_ops = NULL; > > if (!bond_has_slaves(bond)) { > call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists