This is a note to let you know that I've just added the patch titled batman-adv: Hold rtnl lock during MTU update via netlink to the 6.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: batman-adv-hold-rtnl-lock-during-mtu-update-via-netlink.patch and it can be found in the queue-6.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 987aae75fc1041072941ffb622b45ce2359a99b9 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann <sven@xxxxxxxxxxxxx> Date: Mon, 21 Aug 2023 21:48:48 +0200 Subject: batman-adv: Hold rtnl lock during MTU update via netlink From: Sven Eckelmann <sven@xxxxxxxxxxxxx> commit 987aae75fc1041072941ffb622b45ce2359a99b9 upstream. The automatic recalculation of the maximum allowed MTU is usually triggered by code sections which are already rtnl lock protected by callers outside of batman-adv. But when the fragmentation setting is changed via batman-adv's own batadv genl family, then the rtnl lock is not yet taken. But dev_set_mtu requires that the caller holds the rtnl lock because it uses netdevice notifiers. And this code will then fail the check for this lock: RTNL: assertion failed at net/core/dev.c (1953) Cc: stable@xxxxxxxxxxxxxxx Reported-by: syzbot+f8812454d9b3ac00d282@xxxxxxxxxxxxxxxxxxxxxxxxx Fixes: c6a953cce8d0 ("batman-adv: Trigger events for auto adjusted MTU") Signed-off-by: Sven Eckelmann <sven@xxxxxxxxxxxxx> Reviewed-by: Simon Horman <horms@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230821-batadv-missing-mtu-rtnl-lock-v1-1-1c5a7bfe861e@xxxxxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/batman-adv/netlink.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -495,7 +495,10 @@ static int batadv_netlink_set_mesh(struc attr = info->attrs[BATADV_ATTR_FRAGMENTATION_ENABLED]; atomic_set(&bat_priv->fragmentation, !!nla_get_u8(attr)); + + rtnl_lock(); batadv_update_min_mtu(bat_priv->soft_iface); + rtnl_unlock(); } if (info->attrs[BATADV_ATTR_GW_BANDWIDTH_DOWN]) { Patches currently in stable-queue which might be from sven@xxxxxxxxxxxxx are queue-6.4/batman-adv-fix-tt-global-entry-leak-when-client-roamed-back.patch queue-6.4/batman-adv-don-t-increase-mtu-when-set-by-user.patch queue-6.4/batman-adv-do-not-get-eth-header-before-batadv_check_management_packet.patch queue-6.4/batman-adv-trigger-events-for-auto-adjusted-mtu.patch queue-6.4/batman-adv-hold-rtnl-lock-during-mtu-update-via-netlink.patch queue-6.4/batman-adv-fix-batadv_v_ogm_aggr_send-memory-leak.patch