Netdev List
 help / color / mirror / Atom feed
* [PATCH net] tipc: prevent node timer rearm after peer removal
@ 2026-07-14  7:06 David Lee
  0 siblings, 0 replies; only message in thread
From: David Lee @ 2026-07-14  7:06 UTC (permalink / raw)
  To: Jon Maloy
  Cc: David Lee, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Richard Alpe, Ying Xue,
	Dominik 'Disconnect3d' Czarnota, netdev, tipc-discussion,
	linux-kernel

TIPC node deletion removes the node from lookup tables, calls
timer_delete_sync(), and drops the timer reference.  This stops an already
running timer callback, but it does not prevent another racing path from
rearming the same timer after deletion has started.

Synthetic UDP discovery can race TIPC_NL_PEER_REMOVE and link property
updates.  When discovery recreates the first link, tipc_node_check_dest()
calls mod_timer() and retakes the timer reference.  If that happens after
tipc_node_delete() has deleted the timer, the orphaned timer can later run
after network namespace teardown has freed the per-net TIPC state and
broadcast link.

Use timer_shutdown_sync() when deleting a node.  Shutdown has the same
synchronization effect as timer_delete_sync(), and also prevents future
rearming through mod_timer().

Fixes: b34040227be7 ("tipc: add peer removal functionality")
Signed-off-by: David Lee <david.lee@trailofbits.com>
Assisted-by: Codex:gpt-5.5
---
Trail of Bits has a reproducer for this bug demonstrating Kernel Panic which can be shared further if needed.

 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 262b39ecf5f8..5b3ee44347be 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -638,7 +638,7 @@ static void tipc_node_delete(struct tipc_node *node)
 	trace_tipc_node_delete(node, true, " ");
 	tipc_node_delete_from_list(node);
 
-	timer_delete_sync(&node->timer);
+	timer_shutdown_sync(&node->timer);
 	tipc_node_put(node);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-14  7:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14  7:06 [PATCH net] tipc: prevent node timer rearm after peer removal David Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox