From: David Lee <david.lee@trailofbits.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: David Lee <david.lee@trailofbits.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Richard Alpe <richard.alpe@ericsson.com>,
Ying Xue <ying.xue@windriver.com>,
Dominik 'Disconnect3d' Czarnota
<dominik.czarnota@trailofbits.com>,
netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: [PATCH net] tipc: prevent node timer rearm after peer removal
Date: Tue, 14 Jul 2026 07:06:09 +0000 [thread overview]
Message-ID: <20260714070611.1700456-1-david.lee@trailofbits.com> (raw)
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
reply other threads:[~2026-07-14 7:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260714070611.1700456-1-david.lee@trailofbits.com \
--to=david.lee@trailofbits.com \
--cc=davem@davemloft.net \
--cc=dominik.czarnota@trailofbits.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jmaloy@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richard.alpe@ericsson.com \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox