提交 a1badb57 编写于 作者: J Jay Vosburgh 提交者: Sun Shouxin

bonding: fix reference count leak in balance-alb mode

mainline inclusion
from mainline-v6.0
commit 4f5d33f4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5UYT6
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/bonding/bond_alb.c?h=v6.0&id=4f5d33f4f798b1c6d92b613f0087f639d9836971

--------------------------------------------------------------------

Commit d5410ac7 ("net:bonding:support balance-alb interface
with vlan to bridge") introduced a reference count leak by not releasing
the reference acquired by ip_dev_find().  Remedy this by insuring the
reference is released.

Fixes: d5410ac7 ("net:bonding:support balance-alb interface with vlan to bridge")
Signed-off-by: NJay Vosburgh <jay.vosburgh@canonical.com>
Reviewed-by: NNikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/26758.1660194413@famineSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NSun Shouxin <sunshouxin@chinatelecom.cn>
上级 b0b03a7d
......@@ -680,8 +680,11 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
if (dev) {
if (netif_is_bridge_master(dev))
if (netif_is_bridge_master(dev)) {
dev_put(dev);
return NULL;
}
dev_put(dev);
}
if (arp->op_code == htons(ARPOP_REPLY)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册