linux/net/batman-adv
Sven Eckelmann 2ab9f2531d batman-adv: Avoid double-rtnl_lock ELP metric worker
commit cfc83a3c71 upstream.

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 cancelled 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 be called.

Cc: stable@vger.kernel.org
Fixes: 8c8ecc98f5 ("batman-adv: Drop unmanaged ELP metric worker")
Reported-by: Christian Schmidbauer <github@grische.xyz>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Tested-by: Sören Skaarup <freifunk_nordm4nn@gmx.de>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-03-19 16:08:37 +01:00
..
bat_algo.c batman-adv: store hard_iface as iflink private data 2025-05-31 10:41:11 +02:00
bat_algo.h batman-adv: store hard_iface as iflink private data 2025-05-31 10:41:11 +02:00
bat_iv_ogm.c batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
bat_iv_ogm.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
bat_v.c batman-adv: store hard_iface as iflink private data 2025-05-31 10:41:11 +02:00
bat_v.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
bat_v_elp.c batman-adv: Avoid double-rtnl_lock ELP metric worker 2026-03-19 16:08:37 +01:00
bat_v_elp.h batman-adv: Drop unmanaged ELP metric worker 2025-01-22 21:46:42 +01:00
bat_v_ogm.c batman-adv: store hard_iface as iflink private data 2025-05-31 10:41:11 +02:00
bat_v_ogm.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
bitarray.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
bitarray.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
bridge_loop_avoidance.c batman-adv: keep skb crc32 helper local in BLA 2025-09-05 15:11:02 +02:00
bridge_loop_avoidance.h batman-adv: Remove the repeated declaration 2021-05-30 13:38:27 +02:00
distributed-arp-table.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
distributed-arp-table.h batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
fragmentation.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
fragmentation.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
gateway_client.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
gateway_client.h batman-adv: Check ptr for NULL before reducing its refcnt 2021-08-08 20:21:40 +02:00
gateway_common.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
gateway_common.h batman-adv: Drop per algo GW section class code 2023-08-14 18:01:21 +02:00
hard-interface.c batman-adv: Avoid double-rtnl_lock ELP metric worker 2026-03-19 16:08:37 +01:00
hard-interface.h batman-adv: Avoid double-rtnl_lock ELP metric worker 2026-03-19 16:08:37 +01:00
hash.c batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
hash.h batman-adv: Fix spelling mistakes 2021-06-02 08:46:03 +02:00
Kconfig batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
log.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
log.h batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
main.c batman-adv: keep skb crc32 helper local in BLA 2025-09-05 15:11:02 +02:00
main.h batman-adv: keep skb crc32 helper local in BLA 2025-09-05 15:11:02 +02:00
Makefile batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
mesh-interface.c batman-adv: remove includes for extern declarations 2025-09-05 15:11:02 +02:00
mesh-interface.h batman-adv: remove includes for extern declarations 2025-09-05 15:11:02 +02:00
multicast.c batman-adv: store hard_iface as iflink private data 2025-05-31 10:41:11 +02:00
multicast.h batman-adv: mcast: implement multicast packet generation 2023-11-14 08:16:34 +01:00
multicast_forw.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
netlink.c batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
netlink.h batman-adv: remove includes for extern declarations 2025-09-05 15:11:02 +02:00
originator.c Here is a batman-adv bugfix: 2025-10-27 18:00:54 -07:00
originator.h batman-adv: mcast: implement multicast packet reception and forwarding 2023-11-14 08:16:34 +01:00
routing.c batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
routing.h batman-adv: mcast: implement multicast packet reception and forwarding 2023-11-14 08:16:34 +01:00
send.c batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
send.h batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
tp_meter.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
tp_meter.h batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
trace.c batman-adv: Drop publication years from copyright info 2021-02-06 09:22:10 +01:00
trace.h batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
translation-table.c batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00
translation-table.h batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
tvlv.c batman-adv: Use consistent name for mesh interface 2025-02-22 11:36:22 +01:00
tvlv.h batman-adv: tvlv: prepare for tvlv enabled multicast packet type 2023-01-21 19:01:59 +01:00
types.h batman-adv: remove network coding support 2025-09-05 15:11:00 +02:00