All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
	Marek Lindner <mareklindner@neomailbox.ch>,
	Simon Wunderlich <sw@simonwunderlich.de>,
	Antonio Quartulli <a@unstable.cc>,
	"David S. Miller" <davem@davemloft.net>
Cc: syzbot+d454a826e670502484b8@syzkaller.appspotmail.com,
	Sven Eckelmann <sven@narfation.org>
Subject: [PATCH net v2] batman-adv: fix for leaked TVLV handler.
Date: Fri, 24 May 2019 10:59:27 +0100	[thread overview]
Message-ID: <20190524095927.31817-1-jeremy@azazel.net> (raw)
In-Reply-To: <3325808.M3JPgbICzP@bentobox>

A handler for BATADV_TVLV_ROAM was being registered when the
translation-table was initialized, but not unregistered when the
translation-table was freed.  Unregister it.

Fixes: 122edaa05940 ("batman-adv: tvlv - convert roaming adv packet to use tvlv unicast packets")
Reported-by: syzbot+d454a826e670502484b8@syzkaller.appspotmail.com
Reviewed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
Since v1.

  * Added "Fixes:" tag.
  * Added "Reviewed-by:" tag.
  * Changed prefix to "batman-adv:".

 net/batman-adv/translation-table.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 1ddfd5e011ee..8a482c5ec67b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -3813,6 +3813,8 @@ static void batadv_tt_purge(struct work_struct *work)
  */
 void batadv_tt_free(struct batadv_priv *bat_priv)
 {
+	batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_ROAM, 1);
+
 	batadv_tvlv_container_unregister(bat_priv, BATADV_TVLV_TT, 1);
 	batadv_tvlv_handler_unregister(bat_priv, BATADV_TVLV_TT, 1);
 
-- 
2.20.1


      reply	other threads:[~2019-05-24  9:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-21 13:39 memory leak in batadv_tvlv_handler_register syzbot
2019-05-21 19:58 ` [PATCH net] batadv: fix for leaked TVLV handler Jeremy Sowden
2019-05-21 20:48   ` Sven Eckelmann
2019-05-24  7:56     ` Sven Eckelmann
2019-05-24  9:59       ` Jeremy Sowden [this message]

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=20190524095927.31817-1-jeremy@azazel.net \
    --to=jeremy@azazel.net \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=mareklindner@neomailbox.ch \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    --cc=sw@simonwunderlich.de \
    --cc=syzbot+d454a826e670502484b8@syzkaller.appspotmail.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 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.