All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] pull request for net: batman-adv 2024-02-01
@ 2024-02-01 11:01 Simon Wunderlich
  2024-02-01 11:01 ` [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes Simon Wunderlich
  2024-02-01 11:01 ` [PATCH 2/2] batman-adv: mcast: fix memory leak on deleting a batman-adv interface Simon Wunderlich
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:01 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Hi David, hi Jakub,

here are two bugfixes for batman-adv which we would like to have integrated into net.

Please pull or let me know of any problem!

Thank you,
      Simon

The following changes since commit 6613476e225e090cc9aad49be7fa504e290dd33d:

  Linux 6.8-rc1 (2024-01-21 14:11:32 -0800)

are available in the Git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batadv-net-pullrequest-20240201

for you to fetch changes up to 0a186b49bba596b81de5a686ce5bfc9cd48ab3ef:

  batman-adv: mcast: fix memory leak on deleting a batman-adv interface (2024-01-27 09:13:39 +0100)

----------------------------------------------------------------
Here are some batman-adv bugfixes:

 - fix a timeout issue and a memory leak in batman-adv multicast,
   by Linus Lüssing (2 patches)

----------------------------------------------------------------
Linus Lüssing (2):
      batman-adv: mcast: fix mcast packet type counter on timeouted nodes
      batman-adv: mcast: fix memory leak on deleting a batman-adv interface

 net/batman-adv/multicast.c | 3 +++
 1 file changed, 3 insertions(+)

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

* [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes
  2024-02-01 11:01 [PATCH 0/2] pull request for net: batman-adv 2024-02-01 Simon Wunderlich
@ 2024-02-01 11:01 ` Simon Wunderlich
  2024-02-01 17:30   ` patchwork-bot+netdevbpf
  2024-02-01 11:01 ` [PATCH 2/2] batman-adv: mcast: fix memory leak on deleting a batman-adv interface Simon Wunderlich
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:01 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Sven Eckelmann,
	Simon Wunderlich

From: Linus Lüssing <linus.luessing@c0d3.blue>

When a node which does not have the new batman-adv multicast packet type
capability vanishes then the according, global counter erroneously would
not be reduced in response on other nodes. Which in turn leads to the mesh
never switching back to sending with the new multicast packet type.

Fix this by reducing the according counter when such a node times out.

Fixes: 90039133221e ("batman-adv: mcast: implement multicast packet generation")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/multicast.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index d982daea8329..b4f8b4af1722 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -2198,6 +2198,8 @@ void batadv_mcast_purge_orig(struct batadv_orig_node *orig)
 				      BATADV_MCAST_WANT_NO_RTR4);
 	batadv_mcast_want_rtr6_update(bat_priv, orig,
 				      BATADV_MCAST_WANT_NO_RTR6);
+	batadv_mcast_have_mc_ptype_update(bat_priv, orig,
+					  BATADV_MCAST_HAVE_MC_PTYPE_CAPA);
 
 	spin_unlock_bh(&orig->mcast_handler_lock);
 }
-- 
2.39.2


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

* [PATCH 2/2] batman-adv: mcast: fix memory leak on deleting a batman-adv interface
  2024-02-01 11:01 [PATCH 0/2] pull request for net: batman-adv 2024-02-01 Simon Wunderlich
  2024-02-01 11:01 ` [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes Simon Wunderlich
@ 2024-02-01 11:01 ` Simon Wunderlich
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Wunderlich @ 2024-02-01 11:01 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, b.a.t.m.a.n, Linus Lüssing,
	syzbot+ebe64cc5950868e77358, Sven Eckelmann, Simon Wunderlich

From: Linus Lüssing <linus.luessing@c0d3.blue>

The batman-adv multicast tracker TVLV handler is registered for the
new batman-adv multicast packet type upon creating a batman-adv interface,
but not unregistered again upon the interface's deletion, leading to a
memory leak.

Fix this memory leak by calling the according TVLV handler unregister
routine for the multicast tracker TVLV upon batman-adv interface
deletion.

Fixes: 07afe1ba288c ("batman-adv: mcast: implement multicast packet reception and forwarding")
Reported-and-tested-by: syzbot+ebe64cc5950868e77358@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000beadc4060f0cbc23@google.com/
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/multicast.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c
index b4f8b4af1722..14088c4ff2f6 100644
--- a/net/batman-adv/multicast.c
+++ b/net/batman-adv/multicast.c
@@ -2175,6 +2175,7 @@ void batadv_mcast_free(struct batadv_priv *bat_priv)
 	cancel_delayed_work_sync(&bat_priv->mcast.work);
 
 	batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
+	batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST_TRACKER, 1);
 	batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_MCAST, 2);
 
 	/* safely calling outside of worker, as worker was canceled above */
-- 
2.39.2


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

* Re: [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes
  2024-02-01 11:01 ` [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes Simon Wunderlich
@ 2024-02-01 17:30   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-01 17:30 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: davem, kuba, netdev, b.a.t.m.a.n, linus.luessing, sven

Hello:

This series was applied to netdev/net.git (main)
by Simon Wunderlich <sw@simonwunderlich.de>:

On Thu,  1 Feb 2024 12:01:09 +0100 you wrote:
> From: Linus Lüssing <linus.luessing@c0d3.blue>
> 
> When a node which does not have the new batman-adv multicast packet type
> capability vanishes then the according, global counter erroneously would
> not be reduced in response on other nodes. Which in turn leads to the mesh
> never switching back to sending with the new multicast packet type.
> 
> [...]

Here is the summary with links:
  - [1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes
    https://git.kernel.org/netdev/net/c/59f7ea703c38
  - [2/2] batman-adv: mcast: fix memory leak on deleting a batman-adv interface
    https://git.kernel.org/netdev/net/c/0a186b49bba5

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] 4+ messages in thread

end of thread, other threads:[~2024-02-01 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-01 11:01 [PATCH 0/2] pull request for net: batman-adv 2024-02-01 Simon Wunderlich
2024-02-01 11:01 ` [PATCH 1/2] batman-adv: mcast: fix mcast packet type counter on timeouted nodes Simon Wunderlich
2024-02-01 17:30   ` patchwork-bot+netdevbpf
2024-02-01 11:01 ` [PATCH 2/2] batman-adv: mcast: fix memory leak on deleting a batman-adv interface Simon Wunderlich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.