Re: [PATCH batadv 4/5] batman-adv: remove global hardif list

Sven Eckelmann <[email protected]>
Newsgroups org.open-mesh.lists.batman
Message-ID <6325094.lOV4Wx5bFT@sven-desktop>
On Monday, 19 May 2025 22:46:31 CEST Matthias Schiffer wrote:
> @@ -876,6 +869,7 @@ void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface)
>         batadv_purge_outstanding_packets(bat_priv, hard_iface);
>         netdev_put(hard_iface->mesh_iface, &hard_iface->meshif_dev_tracker);
>  
> +       batadv_hardif_generation++;
>         netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->mesh_iface);
>         batadv_hardif_recalc_extra_skbroom(hard_iface->mesh_iface);

I think, the following code also has to be removed from here:


	netdev_put(hard_iface->mesh_iface, &hard_iface->meshif_dev_tracker);
...
	hard_iface->mesh_iface = NULL;


And following has to be added then to the batadv_hardif_release function.

	netdev_put(hard_iface->mesh_iface, &hard_iface->meshif_dev_tracker);

Otherwise code which iterates via RCU over the netdevices list might find a 
batadv_hard_iface which is currently getting removed - but it can still find 
it and might try to access hard_iface->mesh_iface (which is NULL at that 
point).

Regards,
	Sven
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCagAz/AAKCRBND3cr0xT1
yzcFAQDRALiRgoKwOrIr4X3JQNWI1sm+7rpqt3kdSj47zuvl/wEA/pO4scc5JM6P
wEZ1lhcYQzvk54ctpDxojTjYPe2xowc=
=xW22
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.