[net] batadv: fix for leaked TVLV handler.
Commit Message
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.
Reported-by: syzbot+d454a826e670502484b8@syzkaller.appspotmail.com
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
net/batman-adv/translation-table.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Tuesday, 21 May 2019 21:58:57 CEST Jeremy Sowden wrote:
> 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.
>
> Reported-by: syzbot+d454a826e670502484b8@syzkaller.appspotmail.com
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Fixes: 122edaa05940 ("batman-adv: tvlv - convert roaming adv packet to use tvlv unicast packets")
@Marek, @Antonio, please check whether this looks good to you.
Kind regards,
Sven
On Tuesday, 21 May 2019 22:48:32 CEST Sven Eckelmann wrote:
> Fixes: 122edaa05940 ("batman-adv: tvlv - convert roaming adv packet to use tvlv unicast packets")
This patch was queued up [1] for submission but it is the only queued patch at
the moment. And I already saw that David marked this patch as "Under review"
in patchwork [2]. May I ask whether this means that you (David) would directly
apply it (unless there are objections)? If so then we could save ourselves an
extra PR for just this patch. Just depends on what you (David) prefers.
Reviewed-by: Sven Eckelmann <sven@narfation.org>
The only adjustments I personally would like to see when it is applied:
* the Fixes: line
* prefix "batman-adv:" (at least this still seems the one which is usually
used for net/batman-adv/ related code)
But this isn't really a hard requirement and I also use the shorter
"batadv" all the time in other contexts
Kind regards,
Sven
[1] https://git.open-mesh.org/linux-merge.git/commit/17f78dd1bd624a4dd78ed5db3284a63ee807fcc3
[2] https://patchwork.ozlabs.org/patch/1102982/
@@ -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);