netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bonding: fix reference count leak in balance-alb mode
@ 2022-08-11  5:06 Jay Vosburgh
  2022-08-11  8:03 ` Nikolay Aleksandrov
  2022-08-11 16:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jay Vosburgh @ 2022-08-11  5:06 UTC (permalink / raw)
  To: netdev, sunshouxin
  Cc: vfalico, andy, razor, davem, edumazet, kuba, pabeni, linux-kernel,
	huyd12

	Commit d5410ac7b0ba ("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: d5410ac7b0ba ("net:bonding:support balance-alb interface with vlan to bridge")
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>

---
 drivers/net/bonding/bond_alb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 60cb9a0225aa..b9dbad3a8af8 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -668,8 +668,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)) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] bonding: fix reference count leak in balance-alb mode
  2022-08-11  5:06 [PATCH net] bonding: fix reference count leak in balance-alb mode Jay Vosburgh
@ 2022-08-11  8:03 ` Nikolay Aleksandrov
  2022-08-11 16:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2022-08-11  8:03 UTC (permalink / raw)
  To: Jay Vosburgh, netdev, sunshouxin
  Cc: vfalico, andy, davem, edumazet, kuba, pabeni, linux-kernel,
	huyd12

On 11/08/2022 08:06, Jay Vosburgh wrote:
> 	Commit d5410ac7b0ba ("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: d5410ac7b0ba ("net:bonding:support balance-alb interface with vlan to bridge")
> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
> 
> ---
>  drivers/net/bonding/bond_alb.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 60cb9a0225aa..b9dbad3a8af8 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -668,8 +668,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)) {

Nice catch,
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] bonding: fix reference count leak in balance-alb mode
  2022-08-11  5:06 [PATCH net] bonding: fix reference count leak in balance-alb mode Jay Vosburgh
  2022-08-11  8:03 ` Nikolay Aleksandrov
@ 2022-08-11 16:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-11 16:10 UTC (permalink / raw)
  To: Jay Vosburgh
  Cc: netdev, sunshouxin, vfalico, andy, razor, davem, edumazet, kuba,
	pabeni, linux-kernel, huyd12

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 10 Aug 2022 22:06:53 -0700 you wrote:
> Commit d5410ac7b0ba ("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: d5410ac7b0ba ("net:bonding:support balance-alb interface with vlan to bridge")
> Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
> 
> [...]

Here is the summary with links:
  - [net] bonding: fix reference count leak in balance-alb mode
    https://git.kernel.org/netdev/net/c/4f5d33f4f798

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-11 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11  5:06 [PATCH net] bonding: fix reference count leak in balance-alb mode Jay Vosburgh
2022-08-11  8:03 ` Nikolay Aleksandrov
2022-08-11 16:10 ` patchwork-bot+netdevbpf

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).