Re: [PATCH] batman-adv: Avoid double-rtnl_lock ELP metric worker

Sven Eckelmann <[email protected]>
Newsgroups org.open-mesh.lists.batman
Message-ID <2032168.PYKUYFuaPT@ripper>
On Monday, 16 February 2026 20:05:55 CET Sven Eckelmann wrote:
> batadv_v_elp_get_throughput() might be called when the RTNL lock is already
> held. This could be problematic when the work queue item is canceled via
> cancel_delayed_work_sync() in batadv_v_elp_iface_disable(). In this case,
> an rtnl_lock() would cause a deadlock.
> 
> To avoid this, rtnl_trylock() was used in this function to skip the
> retrieval of the ethtool information in case the RTNL lock was already
> held.
> 
> But for cfg80211 interfaces, batadv_get_real_netdev() was called - which
> also uses rtnl_lock(). The approach for __ethtool_get_link_ksettings() must
> also be used instead and the lockless version __batadv_get_real_netdev()
> has to called.
> 
> Fixes: 405d49a20a20 ("batman-adv: Drop unmanaged ELP metric worker")
> Signed-off-by: Sven Eckelmann <[email protected]>
> ---
>  net/batman-adv/bat_v_elp.c      | 10 +++++++++-
>  net/batman-adv/hard-interface.c |  8 ++++----
>  net/batman-adv/hard-interface.h |  1 +
>  3 files changed, 14 insertions(+), 5 deletions(-)


Via github [1]:

Reported-by: Christian Schmidbauer <[email protected]>
Tested-by: Sören Skaarup <[email protected]>

Regards,
	Sven

[1] https://github.com/freifunkMUC/site-ffm/issues/776#issuecomment-3920865984
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCaZXdJAAKCRBND3cr0xT1
y4g2AQCJi6xJCAj2mMDyTpOw/In+7qZr6oEgiJbhHLqUaK/9hwD/cfjpvJLRiI1U
U5syhR6f0hAL0VxcgexYuf0ERYp7oAY=
=Tz3m
-----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.