FAILED: patch "[PATCH] batman-adv: stop tp_meter sessions during mesh teardown" failed to apply to 6.1-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 3d3cf6a7314aca4df0a6dde28ce784a2a30d0166
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026051554-unbutton-gatherer-c472@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3d3cf6a7314aca4df0a6dde28ce784a2a30d0166 Mon Sep 17 00:00:00 2001
From: Jiexun Wang <[email protected]>
Date: Mon, 27 Apr 2026 14:43:34 +0800
Subject: [PATCH] batman-adv: stop tp_meter sessions during mesh teardown
TP meter sessions remain linked on bat_priv->tp_list after the netlink request has already finished. When the mesh interface is removed, batadv_mesh_free() currently tears down the mesh without first draining these sessions.
A running sender thread or a late incoming tp_meter packet can then keep processing against a mesh instance which is already shutting down. Synchronize tp_meter with the mesh lifetime by stopping all active sessions from batadv_mesh_free() and waiting for sender threads to exit before teardown continues.
net/batman-adv/main.c +1 -0
@@ -249,6 +249,7 @@ void batadv_mesh_free(struct net_device *mesh_iface)atomic_set (&bat_priv->mesh_state,BATADV_MESH_DEACTIVATING );batadv_purge_outstanding_packets (bat_priv,NULL ); +batadv_tp_stop_all (bat_priv);batadv_gw_node_free (bat_priv);
net/batman-adv/tp_meter.c +76 -18
145 lines not on this page · raw message
net/batman-adv/tp_meter.h +1 -0
@@ -17,6 +17,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, u32 test_length, u32 *cookie);void batadv_tp_stop (struct batadv_priv *bat_priv,const u8 *dst,u8 return_value); +void batadv_tp_stop_all (struct batadv_priv *bat_priv);void batadv_tp_meter_recv (struct batadv_priv *bat_priv,struct sk_buff *skb);#endif /* _NET_BATMAN_ADV_TP_METER_H_ */
net/batman-adv/types.h +4 -0
@@ -14,6 +14,7 @@#include <linux/average.h> #include <linux/bitops.h> #include <linux/compiler.h> +#include <linux/completion.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/kref.h>
@@ -1328,6 +1329,9 @@ struct batadv_tp_vars {/** @finish_work: work item for the finishing procedure */ struct delayed_work finish_work; +/** @finished: completion signaled when a sender thread exits */ +struct completion finished; +/** @test_length: test length in milliseconds */ u32 test_length;
Sven Eckelmann
maintainerPATCH 1/1 batman-adv: stop tp_meter sessions during mesh teardown
From: Jiexun Wang <[email protected]>
commit 3d3cf6a7314aca4df0a6dde28ce784a2a30d0166 upstream.
TP meter sessions remain linked on bat_priv->tp_list after the netlink request has already finished. When the mesh interface is removed, batadv_mesh_free() currently tears down the mesh without first draining these sessions.
A running sender thread or a late incoming tp_meter packet can then keep processing against a mesh instance which is already shutting down. Synchronize tp_meter with the mesh lifetime by stopping all active sessions from batadv_mesh_free() and waiting for sender threads to exit before teardown continues.
--- net/batman-adv/main.c | 1 + net/batman-adv/tp_meter.c | 94 +++++++++++++++++++++++++++++++-------- net/batman-adv/tp_meter.h | 1 + net/batman-adv/types.h | 4 ++ 4 files changed, 82 insertions(+), 18 deletions(-)
net/batman-adv/main.c +1 -0
@@ -262,6 +262,7 @@ void batadv_mesh_free(struct net_device *soft_iface)atomic_set (&bat_priv->mesh_state,BATADV_MESH_DEACTIVATING );batadv_purge_outstanding_packets (bat_priv,NULL ); +batadv_tp_stop_all (bat_priv);batadv_gw_node_free (bat_priv);
net/batman-adv/tp_meter.c +76 -18
145 lines not on this page · raw message
net/batman-adv/tp_meter.h +1 -0
@@ -17,6 +17,7 @@ void batadv_tp_start(struct batadv_priv *bat_priv, const u8 *dst, u32 test_length, u32 *cookie);void batadv_tp_stop (struct batadv_priv *bat_priv,const u8 *dst,u8 return_value); +void batadv_tp_stop_all (struct batadv_priv *bat_priv);void batadv_tp_meter_recv (struct batadv_priv *bat_priv,struct sk_buff *skb);#endif /* _NET_BATMAN_ADV_TP_METER_H_ */
net/batman-adv/types.h +4 -0
@@ -14,6 +14,7 @@#include <linux/average.h> #include <linux/bitops.h> #include <linux/compiler.h> +#include <linux/completion.h> #include <linux/if.h> #include <linux/if_ether.h> #include <linux/kref.h>
@@ -1396,6 +1397,9 @@ struct batadv_tp_vars {/** @finish_work: work item for the finishing procedure */ struct delayed_work finish_work; +/** @finished: completion signaled when a sender thread exits */ +struct completion finished; +/** @test_length: test length in milliseconds */ u32 test_length;
Signature · 1 line
2.47.3