AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/10/05 04:36 flow patch-triage
1m Args:
null

Results:
{
  "EnableConfigs": [
    "INET",
    "TIPC"
  ],
  "FocusSymbols": [
    "tipc_nametbl_publish",
    "tipc_nametbl_withdraw",
    "tipc_named_node_up",
    "tipc_publ_notify",
    "tipc_named_rcv",
    "tipc_node_subscribe",
    "tipc_node_unsubscribe",
    "tipc_rcv"
  ],
  "KMSANReasoning": "The patch refactors TIPC locking and publication management to avoid deadlocks and race conditions between node locks (`n-\u003elock`) and the name table lock (`tn-\u003enametbl_lock`). Specifically:\n- `tipc_named_node_up` and `tipc_nametbl_publish`/`tipc_nametbl_withdraw` no longer broadcast or transmit packets directly under locks; instead, they defer transmission to callers by passing back an skb or appending to an skb queue (`xmitq`).\n- `tipc_node_subscribe` and `tipc_node_unsubscribe` are simplified to operate directly on the publication list under callers' existing locks.\n- In `tipc_node_write_unlock`, node notification handlers are called with appropriate locking, and outgoing skbs/broadcasts are transmitted after unlocking `n-\u003elock`.\n\nAll newly introduced local variables (e.g., `skb = NULL`, queue head initialized via `__skb_queue_head_init`, `rc_dests` populated when publications are generated) are initialized before use. There are no allocations of uninitialized memory, no structures copied to user space, and no branching on uninitialized data. Any potential bugs introduced by these changes are concurrency, locking (deadlock/lock inversion), or object lifecycle/use-after-free issues, all of which are covered by LOCKDEP and KASAN. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies core TIPC name table distribution, publication, and node subscription logic. It refactors locking patterns and postpones packet broadcast/transmission to be performed outside of locks, altering the interaction between node write locks and name table locks during message reception and publication updates. This reachable networking code can be exercised via AF_TIPC sockets and TIPC packet reception in virtualized environments, making it a prime candidate for fuzzing to discover potential race conditions, deadlocks, or skb leaks.",
  "WorthFuzzing": true
}

1/1 2026/10/05 04:36 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 51b2d9d0aa11997997465cc9c8acc3c045b78800\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Mon Oct 5 04:36:06 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c\nindex ba4f4906e13b7..cf5125212521c 100644\n--- a/net/tipc/name_distr.c\n+++ b/net/tipc/name_distr.c\n@@ -202,8 +202,10 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,\n  * @net: the associated network namespace\n  * @dnode: destination node\n  * @capabilities: peer node's capabilities\n+ * @xmitq: list of skbs need to be sent\n  */\n-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)\n+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,\n+\t\t\tstruct sk_buff_head *xmitq)\n {\n \tstruct name_table *nt = tipc_name_table(net);\n \tstruct tipc_net *tn = tipc_net(net);\n@@ -218,8 +220,7 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)\n \tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n \n \tread_lock_bh(\u0026nt-\u003ecluster_scope_lock);\n-\tnamed_distribute(net, \u0026head, dnode, \u0026nt-\u003ecluster_scope, seqno);\n-\ttipc_node_xmit(net, \u0026head, dnode, 0);\n+\tnamed_distribute(net, xmitq, dnode, \u0026nt-\u003ecluster_scope, seqno);\n \tread_unlock_bh(\u0026nt-\u003ecluster_scope_lock);\n }\n \n@@ -227,12 +228,11 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)\n  * tipc_publ_purge - remove publication associated with a failed node\n  * @net: the associated network namespace\n  * @p: the publication to remove\n- * @addr: failed node's address\n  *\n  * Invoked for each publication issued by a newly failed node.\n  * Removes publication structure from name table \u0026 deletes it.\n  */\n-static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)\n+static void tipc_publ_purge(struct net *net, struct publication *p)\n {\n \tstruct tipc_net *tn = tipc_net(net);\n \tstruct publication *_p;\n@@ -243,14 +243,14 @@ static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)\n \tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n \t_p = tipc_nametbl_remove_publ(net, \u0026ua, \u0026p-\u003esk, p-\u003ekey);\n \tif (_p)\n-\t\ttipc_node_unsubscribe(net, \u0026_p-\u003ebinding_node, addr);\n+\t\ttipc_node_unsubscribe(\u0026_p-\u003ebinding_node);\n \tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n \tif (_p)\n \t\tkfree_rcu(_p, rcu);\n }\n \n void tipc_publ_notify(struct net *net, struct list_head *nsub_list,\n-\t\t      u32 addr, u16 capabilities)\n+\t\t      u16 capabilities)\n {\n \tstruct name_table *nt = tipc_name_table(net);\n \tstruct tipc_net *tn = tipc_net(net);\n@@ -258,7 +258,7 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,\n \tstruct publication *publ, *tmp;\n \n \tlist_for_each_entry_safe(publ, tmp, nsub_list, binding_node)\n-\t\ttipc_publ_purge(net, publ, addr);\n+\t\ttipc_publ_purge(net, publ);\n \tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n \tif (!(capabilities \u0026 TIPC_NAMED_BCAST))\n \t\tnt-\u003erc_dests--;\n@@ -277,7 +277,8 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,\n  * Return: the publication item if successful, otherwise NULL.\n  */\n static bool tipc_update_nametbl(struct net *net, struct distr_item *i,\n-\t\t\t\tu32 node, u32 dtype)\n+\t\t\t\tu32 node, u32 dtype,\n+\t\t\t\tstruct list_head *publ_list)\n {\n \tstruct publication *p = NULL;\n \tu32 lower = ntohl(i-\u003elower);\n@@ -301,13 +302,13 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,\n \tif (dtype == PUBLICATION) {\n \t\tp = tipc_nametbl_insert_publ(net, \u0026ua, \u0026sk, key);\n \t\tif (p) {\n-\t\t\ttipc_node_subscribe(net, \u0026p-\u003ebinding_node, node);\n+\t\t\ttipc_node_subscribe(\u0026p-\u003ebinding_node, publ_list);\n \t\t\treturn true;\n \t\t}\n \t} else if (dtype == WITHDRAWAL) {\n \t\tp = tipc_nametbl_remove_publ(net, \u0026ua, \u0026sk, key);\n \t\tif (p) {\n-\t\t\ttipc_node_unsubscribe(net, \u0026p-\u003ebinding_node, node);\n+\t\t\ttipc_node_unsubscribe(\u0026p-\u003ebinding_node);\n \t\t\tkfree_rcu(p, rcu);\n \t\t\treturn true;\n \t\t}\n@@ -371,7 +372,7 @@ static struct sk_buff *tipc_named_dequeue(struct sk_buff_head *namedq,\n  * @open: last bulk msg was received (FIXME)\n  */\n void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,\n-\t\t    u16 *rcv_nxt, bool *open)\n+\t\t    struct list_head *publ_list, u16 *rcv_nxt, bool *open)\n {\n \tstruct tipc_net *tn = tipc_net(net);\n \tstruct distr_item *item;\n@@ -386,7 +387,8 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,\n \t\titem = (struct distr_item *)msg_data(hdr);\n \t\tcount = msg_data_sz(hdr) / ITEM_SIZE;\n \t\twhile (count--) {\n-\t\t\ttipc_update_nametbl(net, item, node, msg_type(hdr));\n+\t\t\ttipc_update_nametbl(net, item, node,\n+\t\t\t\t\t    msg_type(hdr), publ_list);\n \t\t\titem++;\n \t\t}\n \t\tkfree_skb(skb);\ndiff --git a/net/tipc/name_distr.h b/net/tipc/name_distr.h\nindex c677f6f082dfb..14c008ab8644e 100644\n--- a/net/tipc/name_distr.h\n+++ b/net/tipc/name_distr.h\n@@ -69,11 +69,12 @@ struct distr_item {\n \n struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ);\n struct sk_buff *tipc_named_withdraw(struct net *net, struct publication *publ);\n-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities);\n+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,\n+\t\t\tstruct sk_buff_head *xmitq);\n void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,\n-\t\t    u16 *rcv_nxt, bool *open);\n+\t\t    struct list_head *publ_list, u16 *rcv_nxt, bool *open);\n void tipc_named_reinit(struct net *net);\n void tipc_publ_notify(struct net *net, struct list_head *nsub_list,\n-\t\t      u32 addr, u16 capabilities);\n+\t\t      u16 capabilities);\n \n #endif\ndiff --git a/net/tipc/name_table.c b/net/tipc/name_table.c\nindex 6fda36ab17669..da306d178d564 100644\n--- a/net/tipc/name_table.c\n+++ b/net/tipc/name_table.c\n@@ -760,15 +760,14 @@ void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,\n /* tipc_nametbl_publish - add service binding to name table\n  */\n struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\n-\t\t\t\t\t struct tipc_socket_addr *sk, u32 key)\n+\t\t\t\t\t struct tipc_socket_addr *sk, u32 key,\n+\t\t\t\t\t struct sk_buff **skb, u32 *rc_dests)\n {\n \tstruct name_table *nt = tipc_name_table(net);\n \tu32 max_user_pub = TIPC_MAX_PUBL - 1;\n \tstruct tipc_net *tn = tipc_net(net);\n \tstruct publication *p = NULL;\n-\tstruct sk_buff *skb = NULL;\n \tbool protocol_type = false;\n-\tu32 rc_dests;\n \n \tif (ua-\u003esr.type == TIPC_NODE_STATE || ua-\u003esr.type == TIPC_LINK_STATE ||\n \t    ua-\u003esr.type == TIPC_TOP_SRV)\n@@ -797,14 +796,12 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\n \t\t */\n \t\tif (!protocol_type)\n \t\t\tnt-\u003elocal_publ_count++;\n-\t\tskb = tipc_named_publish(net, p);\n+\t\t*skb = tipc_named_publish(net, p);\n \t}\n-\trc_dests = nt-\u003erc_dests;\n+\t*rc_dests = nt-\u003erc_dests;\n exit:\n \tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n \n-\tif (skb)\n-\t\ttipc_node_broadcast(net, skb, rc_dests);\n \treturn p;\n \n }\n@@ -815,15 +812,16 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\n  * @ua: service address/range being unbound\n  * @sk: address of the socket being unbound from\n  * @key: target publication key\n+ * skb: name distribution message needs to be sent\n+ * rc_dests: the number of replicast destinations\n  */\n void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\n-\t\t\t   struct tipc_socket_addr *sk, u32 key)\n+\t\t\t   struct tipc_socket_addr *sk, u32 key,\n+\t\t\t   struct sk_buff **skb, u32 *rc_dests)\n {\n \tstruct name_table *nt = tipc_name_table(net);\n \tstruct tipc_net *tn = tipc_net(net);\n-\tstruct sk_buff *skb = NULL;\n \tstruct publication *p;\n-\tu32 rc_dests;\n \n \tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n \n@@ -833,15 +831,12 @@ void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\n \t\t    p-\u003esr.type != TIPC_LINK_STATE \u0026\u0026\n \t\t    p-\u003esr.type != TIPC_TOP_SRV)\n \t\t\tnt-\u003elocal_publ_count--;\n-\t\tskb = tipc_named_withdraw(net, p);\n+\t\t*skb = tipc_named_withdraw(net, p);\n \t\tlist_del_init(\u0026p-\u003ebinding_sock);\n \t\tkfree_rcu(p, rcu);\n \t}\n-\trc_dests = nt-\u003erc_dests;\n+\t*rc_dests = nt-\u003erc_dests;\n \tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n-\n-\tif (skb)\n-\t\ttipc_node_broadcast(net, skb, rc_dests);\n }\n \n /**\ndiff --git a/net/tipc/name_table.h b/net/tipc/name_table.h\nindex 7ff6eeebaae64..6cbc9da17464b 100644\n--- a/net/tipc/name_table.h\n+++ b/net/tipc/name_table.h\n@@ -126,9 +126,11 @@ bool tipc_nametbl_lookup_group(struct net *net, struct tipc_uaddr *ua,\n void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,\n \t\t\t      struct tipc_uaddr *ua);\n struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\n-\t\t\t\t\t struct tipc_socket_addr *sk, u32 key);\n+\t\t\t\t\t struct tipc_socket_addr *sk, u32 key,\n+\t\t\t\t\t struct sk_buff **skb, u32 *rc_dests);\n void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\n-\t\t\t   struct tipc_socket_addr *sk, u32 key);\n+\t\t\t   struct tipc_socket_addr *sk, u32 key,\n+\t\t\t   struct sk_buff **skb, u32 *rc_dests);\n struct publication *tipc_nametbl_insert_publ(struct net *net,\n \t\t\t\t\t     struct tipc_uaddr *ua,\n \t\t\t\t\t     struct tipc_socket_addr *sk,\ndiff --git a/net/tipc/net.c b/net/tipc/net.c\nindex 7e65d0b0c4a8d..1e445c5abc0f5 100644\n--- a/net/tipc/net.c\n+++ b/net/tipc/net.c\n@@ -125,9 +125,11 @@ int tipc_net_init(struct net *net, u8 *node_id, u32 addr)\n \n static void tipc_net_finalize(struct net *net, u32 addr)\n {\n-\tstruct tipc_net *tn = tipc_net(net);\n \tstruct tipc_socket_addr sk = {0, addr};\n+\tstruct tipc_net *tn = tipc_net(net);\n+\tstruct sk_buff *skb = NULL;\n \tstruct tipc_uaddr ua;\n+\tu32 rc_dests;\n \n \ttipc_uaddr(\u0026ua, TIPC_SERVICE_RANGE, TIPC_CLUSTER_SCOPE,\n \t\t   TIPC_NODE_STATE, addr, addr);\n@@ -138,7 +140,9 @@ static void tipc_net_finalize(struct net *net, u32 addr)\n \ttipc_named_reinit(net);\n \ttipc_sk_reinit(net);\n \ttipc_mon_reinit_self(net);\n-\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, addr);\n+\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, addr, \u0026skb, \u0026rc_dests);\n+\tif (skb)\n+\t\ttipc_node_broadcast(net, skb, rc_dests);\n }\n \n void tipc_net_finalize_work(struct work_struct *work)\ndiff --git a/net/tipc/node.c b/net/tipc/node.c\nindex d7cbfa786c132..182c6dbfa49d2 100644\n--- a/net/tipc/node.c\n+++ b/net/tipc/node.c\n@@ -397,44 +397,50 @@ static void tipc_node_write_unlock(struct tipc_node *n)\n \t__releases(n-\u003elock)\n {\n \tstruct tipc_socket_addr sk;\n+\tstruct sk_buff *skb = NULL;\n+\tstruct sk_buff_head xmitq;\n \tstruct net *net = n-\u003enet;\n-\tu32 flags = n-\u003eaction_flags;\n-\tstruct list_head *publ_list;\n \tstruct tipc_uaddr ua;\n \tu32 bearer_id, node;\n+\tu32 rc_dests;\n \n-\tif (likely(!flags)) {\n+\tif (likely(!n-\u003eaction_flags)) {\n \t\twrite_unlock_bh(\u0026n-\u003elock);\n \t\treturn;\n \t}\n \n+\t__skb_queue_head_init(\u0026xmitq);\n \ttipc_uaddr(\u0026ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE,\n \t\t   TIPC_LINK_STATE, n-\u003eaddr, n-\u003eaddr);\n \tsk.ref = n-\u003elink_id;\n \tsk.node = tipc_own_addr(net);\n \tnode = n-\u003eaddr;\n \tbearer_id = n-\u003elink_id \u0026 0xffff;\n-\tpubl_list = \u0026n-\u003epubl_list;\n-\n-\tn-\u003eaction_flags \u0026= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |\n-\t\t\t     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);\n \n-\twrite_unlock_bh(\u0026n-\u003elock);\n+\tif (n-\u003eaction_flags \u0026 TIPC_NOTIFY_NODE_DOWN)\n+\t\ttipc_publ_notify(net, \u0026n-\u003epubl_list, n-\u003ecapabilities);\n \n-\tif (flags \u0026 TIPC_NOTIFY_NODE_DOWN)\n-\t\ttipc_publ_notify(net, publ_list, node, n-\u003ecapabilities);\n+\tif (n-\u003eaction_flags \u0026 TIPC_NOTIFY_NODE_UP)\n+\t\ttipc_named_node_up(net, node, n-\u003ecapabilities, \u0026xmitq);\n \n-\tif (flags \u0026 TIPC_NOTIFY_NODE_UP)\n-\t\ttipc_named_node_up(net, node, n-\u003ecapabilities);\n-\n-\tif (flags \u0026 TIPC_NOTIFY_LINK_UP) {\n+\tif (n-\u003eaction_flags \u0026 TIPC_NOTIFY_LINK_UP) {\n \t\ttipc_mon_peer_up(net, node, bearer_id);\n-\t\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, sk.ref);\n+\t\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, sk.ref, \u0026skb, \u0026rc_dests);\n \t}\n-\tif (flags \u0026 TIPC_NOTIFY_LINK_DOWN) {\n+\tif (n-\u003eaction_flags \u0026 TIPC_NOTIFY_LINK_DOWN) {\n \t\ttipc_mon_peer_down(net, node, bearer_id);\n-\t\ttipc_nametbl_withdraw(net, \u0026ua, \u0026sk, sk.ref);\n+\t\ttipc_nametbl_withdraw(net, \u0026ua, \u0026sk, sk.ref, \u0026skb, \u0026rc_dests);\n \t}\n+\n+\tn-\u003eaction_flags \u0026= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |\n+\t\t\t     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);\n+\twrite_unlock_bh(\u0026n-\u003elock);\n+\n+\tif (!skb_queue_empty(\u0026xmitq))\n+\t\ttipc_node_xmit(net, \u0026xmitq, node, 0);\n+\n+\tif (skb)\n+\t\ttipc_node_broadcast(net, skb, rc_dests);\n }\n \n static void tipc_node_assign_peer_net(struct tipc_node *n, u32 hash_mixes)\n@@ -653,40 +659,14 @@ void tipc_node_stop(struct net *net)\n \tspin_unlock_bh(\u0026tn-\u003enode_list_lock);\n }\n \n-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr)\n+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list)\n {\n-\tstruct tipc_node *n;\n-\n-\tif (in_own_node(net, addr))\n-\t\treturn;\n-\n-\tn = tipc_node_find(net, addr);\n-\tif (!n) {\n-\t\tpr_warn(\"Node subscribe rejected, unknown node 0x%x\\n\", addr);\n-\t\treturn;\n-\t}\n-\ttipc_node_write_lock(n);\n-\tlist_add_tail(subscr, \u0026n-\u003epubl_list);\n-\ttipc_node_write_unlock_fast(n);\n-\ttipc_node_put(n);\n+\tlist_add_tail(subscr, publ_list);\n }\n \n-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr)\n+void tipc_node_unsubscribe(struct list_head *subscr)\n {\n-\tstruct tipc_node *n;\n-\n-\tif (in_own_node(net, addr))\n-\t\treturn;\n-\n-\tn = tipc_node_find(net, addr);\n-\tif (!n) {\n-\t\tpr_warn(\"Node unsubscribe rejected, unknown node 0x%x\\n\", addr);\n-\t\treturn;\n-\t}\n-\ttipc_node_write_lock(n);\n \tlist_del_init(subscr);\n-\ttipc_node_write_unlock_fast(n);\n-\ttipc_node_put(n);\n }\n \n int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port)\n@@ -1917,10 +1897,14 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id\n \t\ttipc_node_mcast_rcv(n);\n \n \t/* Handle NAME_DISTRIBUTOR messages sent from 1.7 nodes */\n-\tif (!skb_queue_empty(\u0026n-\u003ebc_entry.namedq))\n+\tif (!skb_queue_empty(\u0026n-\u003ebc_entry.namedq)) {\n+\t\ttipc_node_write_lock(n);\n \t\ttipc_named_rcv(net, \u0026n-\u003ebc_entry.namedq,\n+\t\t\t       \u0026n-\u003epubl_list,\n \t\t\t       \u0026n-\u003ebc_entry.named_rcv_nxt,\n \t\t\t       \u0026n-\u003ebc_entry.named_open);\n+\t\ttipc_node_write_unlock_fast(n);\n+\t}\n \n \t/* If reassembly or retransmission failure =\u003e reset all links to peer */\n \tif (rc \u0026 TIPC_LINK_DOWN_EVT)\n@@ -2198,10 +2182,14 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)\n \tif (unlikely(rc \u0026 TIPC_LINK_DOWN_EVT))\n \t\ttipc_node_link_down(n, bearer_id, false);\n \n-\tif (unlikely(!skb_queue_empty(\u0026n-\u003ebc_entry.namedq)))\n+\tif (unlikely(!skb_queue_empty(\u0026n-\u003ebc_entry.namedq))) {\n+\t\ttipc_node_write_lock(n);\n \t\ttipc_named_rcv(net, \u0026n-\u003ebc_entry.namedq,\n+\t\t\t       \u0026n-\u003epubl_list,\n \t\t\t       \u0026n-\u003ebc_entry.named_rcv_nxt,\n \t\t\t       \u0026n-\u003ebc_entry.named_open);\n+\t\ttipc_node_write_unlock_fast(n);\n+\t}\n \n \tif (unlikely(!skb_queue_empty(\u0026n-\u003ebc_entry.inputq1)))\n \t\ttipc_node_mcast_rcv(n);\ndiff --git a/net/tipc/node.h b/net/tipc/node.h\nindex 154a5bbb0d29d..3599e48457bb9 100644\n--- a/net/tipc/node.h\n+++ b/net/tipc/node.h\n@@ -103,8 +103,8 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode,\n int tipc_node_distr_xmit(struct net *net, struct sk_buff_head *list);\n int tipc_node_xmit_skb(struct net *net, struct sk_buff *skb, u32 dest,\n \t\t       u32 selector);\n-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr);\n-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr);\n+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list);\n+void tipc_node_unsubscribe(struct list_head *subscr);\n void tipc_node_broadcast(struct net *net, struct sk_buff *skb, int rc_dests);\n int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port);\n void tipc_node_remove_conn(struct net *net, u32 dnode, u32 port);\ndiff --git a/net/tipc/socket.c b/net/tipc/socket.c\nindex d5d70eb230b56..dda247db0e60d 100644\n--- a/net/tipc/socket.c\n+++ b/net/tipc/socket.c\n@@ -2906,23 +2906,27 @@ static void tipc_sk_timeout(struct timer_list *t)\n \n static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n {\n-\tstruct sock *sk = \u0026tsk-\u003esk;\n-\tstruct net *net = sock_net(sk);\n+\tstruct net *net = sock_net(\u0026tsk-\u003esk);\n \tstruct tipc_socket_addr skaddr;\n+\tstruct sk_buff *skb = NULL;\n \tstruct publication *p;\n+\tu32 rc_dests;\n \tu32 key;\n \n-\tif (tipc_sk_connected(sk))\n+\tif (tipc_sk_connected(\u0026tsk-\u003esk))\n \t\treturn -EINVAL;\n \tkey = tsk-\u003eportid + tsk-\u003epub_count + 1;\n \tif (key == tsk-\u003eportid)\n \t\treturn -EADDRINUSE;\n \tskaddr.ref = tsk-\u003eportid;\n \tskaddr.node = tipc_own_addr(net);\n-\tp = tipc_nametbl_publish(net, ua, \u0026skaddr, key);\n+\tp = tipc_nametbl_publish(net, ua, \u0026skaddr, key, \u0026skb, \u0026rc_dests);\n \tif (unlikely(!p))\n \t\treturn -EINVAL;\n \n+\tif (skb)\n+\t\ttipc_node_broadcast(net, skb, rc_dests);\n+\n \tlist_add(\u0026p-\u003ebinding_sock, \u0026tsk-\u003epublications);\n \ttsk-\u003epub_count++;\n \ttsk-\u003epublished = true;\n@@ -2934,13 +2938,19 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n \tstruct net *net = sock_net(\u0026tsk-\u003esk);\n \tstruct publication *safe, *p;\n \tstruct tipc_uaddr _ua;\n+\tstruct sk_buff *skb;\n \tint rc = -EINVAL;\n+\tu32 rc_dests;\n \n \tlist_for_each_entry_safe(p, safe, \u0026tsk-\u003epublications, binding_sock) {\n+\t\tskb = NULL;\n \t\tif (!ua) {\n \t\t\ttipc_uaddr(\u0026_ua, TIPC_SERVICE_RANGE, p-\u003escope,\n \t\t\t\t   p-\u003esr.type, p-\u003esr.lower, p-\u003esr.upper);\n-\t\t\ttipc_nametbl_withdraw(net, \u0026_ua, \u0026p-\u003esk, p-\u003ekey);\n+\t\t\ttipc_nametbl_withdraw(net, \u0026_ua, \u0026p-\u003esk, p-\u003ekey,\n+\t\t\t\t\t      \u0026skb, \u0026rc_dests);\n+\t\t\tif (skb)\n+\t\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n \t\t\tcontinue;\n \t\t}\n \t\t/* Unbind specific publication */\n@@ -2952,7 +2962,9 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n \t\t\tcontinue;\n \t\tif (p-\u003esr.upper != ua-\u003esr.upper)\n \t\t\tbreak;\n-\t\ttipc_nametbl_withdraw(net, ua, \u0026p-\u003esk, p-\u003ekey);\n+\t\ttipc_nametbl_withdraw(net, ua, \u0026p-\u003esk, p-\u003ekey, \u0026skb, \u0026rc_dests);\n+\t\tif (skb)\n+\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n \t\trc = 0;\n \t\tbreak;\n \t}\n"
}

2/1 2026/10/05 04:36 agent patch-evaluator
0m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "INET",
    "TIPC"
  ],
  "FocusSymbols": [
    "tipc_nametbl_publish",
    "tipc_nametbl_withdraw",
    "tipc_named_node_up",
    "tipc_publ_notify",
    "tipc_named_rcv",
    "tipc_node_subscribe",
    "tipc_node_unsubscribe",
    "tipc_rcv"
  ],
  "Reasoning": "The patch modifies core TIPC name table distribution, publication, and node subscription logic. It refactors locking patterns and postpones packet broadcast/transmission to be performed outside of locks, altering the interaction between node write locks and name table locks during message reception and publication updates. This reachable networking code can be exercised via AF_TIPC sockets and TIPC packet reception in virtualized environments, making it a prime candidate for fuzzing to discover potential race conditions, deadlocks, or skb leaks.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit 51b2d9d0aa11997997465cc9c8acc3c045b78800
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Oct 5 04:36:06 2026 +0000

    syz-cluster: applied patch under review

diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index ba4f4906e13b7..cf5125212521c 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -202,8 +202,10 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
  * @net: the associated network namespace
  * @dnode: destination node
  * @capabilities: peer node's capabilities
+ * @xmitq: list of skbs need to be sent
  */
-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,
+			struct sk_buff_head *xmitq)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
@@ -218,8 +220,7 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
 	spin_unlock_bh(&tn->nametbl_lock);
 
 	read_lock_bh(&nt->cluster_scope_lock);
-	named_distribute(net, &head, dnode, &nt->cluster_scope, seqno);
-	tipc_node_xmit(net, &head, dnode, 0);
+	named_distribute(net, xmitq, dnode, &nt->cluster_scope, seqno);
 	read_unlock_bh(&nt->cluster_scope_lock);
 }
 
@@ -227,12 +228,11 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
  * tipc_publ_purge - remove publication associated with a failed node
  * @net: the associated network namespace
  * @p: the publication to remove
- * @addr: failed node's address
  *
  * Invoked for each publication issued by a newly failed node.
  * Removes publication structure from name table & deletes it.
  */
-static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)
+static void tipc_publ_purge(struct net *net, struct publication *p)
 {
 	struct tipc_net *tn = tipc_net(net);
 	struct publication *_p;
@@ -243,14 +243,14 @@ static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)
 	spin_lock_bh(&tn->nametbl_lock);
 	_p = tipc_nametbl_remove_publ(net, &ua, &p->sk, p->key);
 	if (_p)
-		tipc_node_unsubscribe(net, &_p->binding_node, addr);
+		tipc_node_unsubscribe(&_p->binding_node);
 	spin_unlock_bh(&tn->nametbl_lock);
 	if (_p)
 		kfree_rcu(_p, rcu);
 }
 
 void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
-		      u32 addr, u16 capabilities)
+		      u16 capabilities)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
@@ -258,7 +258,7 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
 	struct publication *publ, *tmp;
 
 	list_for_each_entry_safe(publ, tmp, nsub_list, binding_node)
-		tipc_publ_purge(net, publ, addr);
+		tipc_publ_purge(net, publ);
 	spin_lock_bh(&tn->nametbl_lock);
 	if (!(capabilities & TIPC_NAMED_BCAST))
 		nt->rc_dests--;
@@ -277,7 +277,8 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
  * Return: the publication item if successful, otherwise NULL.
  */
 static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
-				u32 node, u32 dtype)
+				u32 node, u32 dtype,
+				struct list_head *publ_list)
 {
 	struct publication *p = NULL;
 	u32 lower = ntohl(i->lower);
@@ -301,13 +302,13 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
 	if (dtype == PUBLICATION) {
 		p = tipc_nametbl_insert_publ(net, &ua, &sk, key);
 		if (p) {
-			tipc_node_subscribe(net, &p->binding_node, node);
+			tipc_node_subscribe(&p->binding_node, publ_list);
 			return true;
 		}
 	} else if (dtype == WITHDRAWAL) {
 		p = tipc_nametbl_remove_publ(net, &ua, &sk, key);
 		if (p) {
-			tipc_node_unsubscribe(net, &p->binding_node, node);
+			tipc_node_unsubscribe(&p->binding_node);
 			kfree_rcu(p, rcu);
 			return true;
 		}
@@ -371,7 +372,7 @@ static struct sk_buff *tipc_named_dequeue(struct sk_buff_head *namedq,
  * @open: last bulk msg was received (FIXME)
  */
 void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
-		    u16 *rcv_nxt, bool *open)
+		    struct list_head *publ_list, u16 *rcv_nxt, bool *open)
 {
 	struct tipc_net *tn = tipc_net(net);
 	struct distr_item *item;
@@ -386,7 +387,8 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
 		item = (struct distr_item *)msg_data(hdr);
 		count = msg_data_sz(hdr) / ITEM_SIZE;
 		while (count--) {
-			tipc_update_nametbl(net, item, node, msg_type(hdr));
+			tipc_update_nametbl(net, item, node,
+					    msg_type(hdr), publ_list);
 			item++;
 		}
 		kfree_skb(skb);
diff --git a/net/tipc/name_distr.h b/net/tipc/name_distr.h
index c677f6f082dfb..14c008ab8644e 100644
--- a/net/tipc/name_distr.h
+++ b/net/tipc/name_distr.h
@@ -69,11 +69,12 @@ struct distr_item {
 
 struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ);
 struct sk_buff *tipc_named_withdraw(struct net *net, struct publication *publ);
-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities);
+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,
+			struct sk_buff_head *xmitq);
 void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
-		    u16 *rcv_nxt, bool *open);
+		    struct list_head *publ_list, u16 *rcv_nxt, bool *open);
 void tipc_named_reinit(struct net *net);
 void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
-		      u32 addr, u16 capabilities);
+		      u16 capabilities);
 
 #endif
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 6fda36ab17669..da306d178d564 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -760,15 +760,14 @@ void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
 /* tipc_nametbl_publish - add service binding to name table
  */
 struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
-					 struct tipc_socket_addr *sk, u32 key)
+					 struct tipc_socket_addr *sk, u32 key,
+					 struct sk_buff **skb, u32 *rc_dests)
 {
 	struct name_table *nt = tipc_name_table(net);
 	u32 max_user_pub = TIPC_MAX_PUBL - 1;
 	struct tipc_net *tn = tipc_net(net);
 	struct publication *p = NULL;
-	struct sk_buff *skb = NULL;
 	bool protocol_type = false;
-	u32 rc_dests;
 
 	if (ua->sr.type == TIPC_NODE_STATE || ua->sr.type == TIPC_LINK_STATE ||
 	    ua->sr.type == TIPC_TOP_SRV)
@@ -797,14 +796,12 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
 		 */
 		if (!protocol_type)
 			nt->local_publ_count++;
-		skb = tipc_named_publish(net, p);
+		*skb = tipc_named_publish(net, p);
 	}
-	rc_dests = nt->rc_dests;
+	*rc_dests = nt->rc_dests;
 exit:
 	spin_unlock_bh(&tn->nametbl_lock);
 
-	if (skb)
-		tipc_node_broadcast(net, skb, rc_dests);
 	return p;
 
 }
@@ -815,15 +812,16 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
  * @ua: service address/range being unbound
  * @sk: address of the socket being unbound from
  * @key: target publication key
+ * skb: name distribution message needs to be sent
+ * rc_dests: the number of replicast destinations
  */
 void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
-			   struct tipc_socket_addr *sk, u32 key)
+			   struct tipc_socket_addr *sk, u32 key,
+			   struct sk_buff **skb, u32 *rc_dests)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
-	struct sk_buff *skb = NULL;
 	struct publication *p;
-	u32 rc_dests;
 
 	spin_lock_bh(&tn->nametbl_lock);
 
@@ -833,15 +831,12 @@ void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
 		    p->sr.type != TIPC_LINK_STATE &&
 		    p->sr.type != TIPC_TOP_SRV)
 			nt->local_publ_count--;
-		skb = tipc_named_withdraw(net, p);
+		*skb = tipc_named_withdraw(net, p);
 		list_del_init(&p->binding_sock);
 		kfree_rcu(p, rcu);
 	}
-	rc_dests = nt->rc_dests;
+	*rc_dests = nt->rc_dests;
 	spin_unlock_bh(&tn->nametbl_lock);
-
-	if (skb)
-		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 /**
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index 7ff6eeebaae64..6cbc9da17464b 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -126,9 +126,11 @@ bool tipc_nametbl_lookup_group(struct net *net, struct tipc_uaddr *ua,
 void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
 			      struct tipc_uaddr *ua);
 struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
-					 struct tipc_socket_addr *sk, u32 key);
+					 struct tipc_socket_addr *sk, u32 key,
+					 struct sk_buff **skb, u32 *rc_dests);
 void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
-			   struct tipc_socket_addr *sk, u32 key);
+			   struct tipc_socket_addr *sk, u32 key,
+			   struct sk_buff **skb, u32 *rc_dests);
 struct publication *tipc_nametbl_insert_publ(struct net *net,
 					     struct tipc_uaddr *ua,
 					     struct tipc_socket_addr *sk,
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 7e65d0b0c4a8d..1e445c5abc0f5 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -125,9 +125,11 @@ int tipc_net_init(struct net *net, u8 *node_id, u32 addr)
 
 static void tipc_net_finalize(struct net *net, u32 addr)
 {
-	struct tipc_net *tn = tipc_net(net);
 	struct tipc_socket_addr sk = {0, addr};
+	struct tipc_net *tn = tipc_net(net);
+	struct sk_buff *skb = NULL;
 	struct tipc_uaddr ua;
+	u32 rc_dests;
 
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_CLUSTER_SCOPE,
 		   TIPC_NODE_STATE, addr, addr);
@@ -138,7 +140,9 @@ static void tipc_net_finalize(struct net *net, u32 addr)
 	tipc_named_reinit(net);
 	tipc_sk_reinit(net);
 	tipc_mon_reinit_self(net);
-	tipc_nametbl_publish(net, &ua, &sk, addr);
+	tipc_nametbl_publish(net, &ua, &sk, addr, &skb, &rc_dests);
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 void tipc_net_finalize_work(struct work_struct *work)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index d7cbfa786c132..182c6dbfa49d2 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -397,44 +397,50 @@ static void tipc_node_write_unlock(struct tipc_node *n)
 	__releases(n->lock)
 {
 	struct tipc_socket_addr sk;
+	struct sk_buff *skb = NULL;
+	struct sk_buff_head xmitq;
 	struct net *net = n->net;
-	u32 flags = n->action_flags;
-	struct list_head *publ_list;
 	struct tipc_uaddr ua;
 	u32 bearer_id, node;
+	u32 rc_dests;
 
-	if (likely(!flags)) {
+	if (likely(!n->action_flags)) {
 		write_unlock_bh(&n->lock);
 		return;
 	}
 
+	__skb_queue_head_init(&xmitq);
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE,
 		   TIPC_LINK_STATE, n->addr, n->addr);
 	sk.ref = n->link_id;
 	sk.node = tipc_own_addr(net);
 	node = n->addr;
 	bearer_id = n->link_id & 0xffff;
-	publ_list = &n->publ_list;
-
-	n->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |
-			     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);
 
-	write_unlock_bh(&n->lock);
+	if (n->action_flags & TIPC_NOTIFY_NODE_DOWN)
+		tipc_publ_notify(net, &n->publ_list, n->capabilities);
 
-	if (flags & TIPC_NOTIFY_NODE_DOWN)
-		tipc_publ_notify(net, publ_list, node, n->capabilities);
+	if (n->action_flags & TIPC_NOTIFY_NODE_UP)
+		tipc_named_node_up(net, node, n->capabilities, &xmitq);
 
-	if (flags & TIPC_NOTIFY_NODE_UP)
-		tipc_named_node_up(net, node, n->capabilities);
-
-	if (flags & TIPC_NOTIFY_LINK_UP) {
+	if (n->action_flags & TIPC_NOTIFY_LINK_UP) {
 		tipc_mon_peer_up(net, node, bearer_id);
-		tipc_nametbl_publish(net, &ua, &sk, sk.ref);
+		tipc_nametbl_publish(net, &ua, &sk, sk.ref, &skb, &rc_dests);
 	}
-	if (flags & TIPC_NOTIFY_LINK_DOWN) {
+	if (n->action_flags & TIPC_NOTIFY_LINK_DOWN) {
 		tipc_mon_peer_down(net, node, bearer_id);
-		tipc_nametbl_withdraw(net, &ua, &sk, sk.ref);
+		tipc_nametbl_withdraw(net, &ua, &sk, sk.ref, &skb, &rc_dests);
 	}
+
+	n->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |
+			     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);
+	write_unlock_bh(&n->lock);
+
+	if (!skb_queue_empty(&xmitq))
+		tipc_node_xmit(net, &xmitq, node, 0);
+
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 static void tipc_node_assign_peer_net(struct tipc_node *n, u32 hash_mixes)
@@ -653,40 +659,14 @@ void tipc_node_stop(struct net *net)
 	spin_unlock_bh(&tn->node_list_lock);
 }
 
-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr)
+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list)
 {
-	struct tipc_node *n;
-
-	if (in_own_node(net, addr))
-		return;
-
-	n = tipc_node_find(net, addr);
-	if (!n) {
-		pr_warn("Node subscribe rejected, unknown node 0x%x\n", addr);
-		return;
-	}
-	tipc_node_write_lock(n);
-	list_add_tail(subscr, &n->publ_list);
-	tipc_node_write_unlock_fast(n);
-	tipc_node_put(n);
+	list_add_tail(subscr, publ_list);
 }
 
-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr)
+void tipc_node_unsubscribe(struct list_head *subscr)
 {
-	struct tipc_node *n;
-
-	if (in_own_node(net, addr))
-		return;
-
-	n = tipc_node_find(net, addr);
-	if (!n) {
-		pr_warn("Node unsubscribe rejected, unknown node 0x%x\n", addr);
-		return;
-	}
-	tipc_node_write_lock(n);
 	list_del_init(subscr);
-	tipc_node_write_unlock_fast(n);
-	tipc_node_put(n);
 }
 
 int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port)
@@ -1917,10 +1897,14 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
 		tipc_node_mcast_rcv(n);
 
 	/* Handle NAME_DISTRIBUTOR messages sent from 1.7 nodes */
-	if (!skb_queue_empty(&n->bc_entry.namedq))
+	if (!skb_queue_empty(&n->bc_entry.namedq)) {
+		tipc_node_write_lock(n);
 		tipc_named_rcv(net, &n->bc_entry.namedq,
+			       &n->publ_list,
 			       &n->bc_entry.named_rcv_nxt,
 			       &n->bc_entry.named_open);
+		tipc_node_write_unlock_fast(n);
+	}
 
 	/* If reassembly or retransmission failure => reset all links to peer */
 	if (rc & TIPC_LINK_DOWN_EVT)
@@ -2198,10 +2182,14 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
 	if (unlikely(rc & TIPC_LINK_DOWN_EVT))
 		tipc_node_link_down(n, bearer_id, false);
 
-	if (unlikely(!skb_queue_empty(&n->bc_entry.namedq)))
+	if (unlikely(!skb_queue_empty(&n->bc_entry.namedq))) {
+		tipc_node_write_lock(n);
 		tipc_named_rcv(net, &n->bc_entry.namedq,
+			       &n->publ_list,
 			       &n->bc_entry.named_rcv_nxt,
 			       &n->bc_entry.named_open);
+		tipc_node_write_unlock_fast(n);
+	}
 
 	if (unlikely(!skb_queue_empty(&n->bc_entry.inputq1)))
 		tipc_node_mcast_rcv(n);
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 154a5bbb0d29d..3599e48457bb9 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -103,8 +103,8 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode,
 int tipc_node_distr_xmit(struct net *net, struct sk_buff_head *list);
 int tipc_node_xmit_skb(struct net *net, struct sk_buff *skb, u32 dest,
 		       u32 selector);
-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr);
-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr);
+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list);
+void tipc_node_unsubscribe(struct list_head *subscr);
 void tipc_node_broadcast(struct net *net, struct sk_buff *skb, int rc_dests);
 int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port);
 void tipc_node_remove_conn(struct net *net, u32 dnode, u32 port);
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index d5d70eb230b56..dda247db0e60d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2906,23 +2906,27 @@ static void tipc_sk_timeout(struct timer_list *t)
 
 static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 {
-	struct sock *sk = &tsk->sk;
-	struct net *net = sock_net(sk);
+	struct net *net = sock_net(&tsk->sk);
 	struct tipc_socket_addr skaddr;
+	struct sk_buff *skb = NULL;
 	struct publication *p;
+	u32 rc_dests;
 	u32 key;
 
-	if (tipc_sk_connected(sk))
+	if (tipc_sk_connected(&tsk->sk))
 		return -EINVAL;
 	key = tsk->portid + tsk->pub_count + 1;
 	if (key == tsk->portid)
 		return -EADDRINUSE;
 	skaddr.ref = tsk->portid;
 	skaddr.node = tipc_own_addr(net);
-	p = tipc_nametbl_publish(net, ua, &skaddr, key);
+	p = tipc_nametbl_publish(net, ua, &skaddr, key, &skb, &rc_dests);
 	if (unlikely(!p))
 		return -EINVAL;
 
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
+
 	list_add(&p->binding_sock, &tsk->publications);
 	tsk->pub_count++;
 	tsk->published = true;
@@ -2934,13 +2938,19 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 	struct net *net = sock_net(&tsk->sk);
 	struct publication *safe, *p;
 	struct tipc_uaddr _ua;
+	struct sk_buff *skb;
 	int rc = -EINVAL;
+	u32 rc_dests;
 
 	list_for_each_entry_safe(p, safe, &tsk->publications, binding_sock) {
+		skb = NULL;
 		if (!ua) {
 			tipc_uaddr(&_ua, TIPC_SERVICE_RANGE, p->scope,
 				   p->sr.type, p->sr.lower, p->sr.upper);
-			tipc_nametbl_withdraw(net, &_ua, &p->sk, p->key);
+			tipc_nametbl_withdraw(net, &_ua, &p->sk, p->key,
+					      &skb, &rc_dests);
+			if (skb)
+				tipc_node_broadcast(net, skb, rc_dests);
 			continue;
 		}
 		/* Unbind specific publication */
@@ -2952,7 +2962,9 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 			continue;
 		if (p->sr.upper != ua->sr.upper)
 			break;
-		tipc_nametbl_withdraw(net, ua, &p->sk, p->key);
+		tipc_nametbl_withdraw(net, ua, &p->sk, p->key, &skb, &rc_dests);
+		if (skb)
+			tipc_node_broadcast(net, skb, rc_dests);
 		rc = 0;
 		break;
 	}

3/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 10305
							output: 27
							thoughts: 457
						

Thoughts:
**Analyzing the TIPC Patch for Fuzzing Potential**

Okay, let's dive into this patch and the associated review request. It's touching `net/tipc/`, the Transparent Inter-Process Communication protocol. The modified files – `name_distr.c`, `name_distr.h`, `name_table.c`, `name_table.h`, `net.c`, `node.c`, `node.h`, and `socket.c` – give us a solid starting point.

Now, the crucial question: is TIPC reachable and therefore worth fuzzing? I know from experience that TIPC, as a networking protocol within the Linux kernel (specifically the `AF_TIPC` socket family), is actively fuzzed by tools like Syzkaller. It’s a target for both socket fuzzing and protocol packet fuzzing via various channels like netlink, loopback, and sockets calls.

Let's quickly recap the core triage philosophy. The objective here is to sniff out crashes, regressions, hidden bugs, or newly activated assertions introduced by this patch. Reachability is key. The fuzzing needs to be able to hit the code in standard virtualized environments, which is certainly the case for TIPC, as it falls under "Reachable Drivers and Protocols" and specifically "Core Networking"! So, this seems like a solid candidate.

Now, time to get more detail on the changes. Let me see what tools are at my disposal. I’ll try using `grepper`, `read-file`, `codesearch-dir-index`, and `set-results` to get a more concrete understanding of the git commit.

Finally, I should check the Kconfig files to ensure `CONFIG_TIPC` is enabled and identify any other necessary configurations. This ensures we can build and run it.



4/2 2026/10/05 04:36 tool grepper
0m Args:
{
  "Expression": "config TIPC",
  "PathPrefix": "net/tipc"
}

Results:
{
  "Output": "net/tipc/Kconfig-5-\nnet/tipc/Kconfig:6:menuconfig TIPC\nnet/tipc/Kconfig-7-\ttristate \"The TIPC Protocol\"\n--\nnet/tipc/Kconfig-23-\nnet/tipc/Kconfig:24:config TIPC_MEDIA_IB\nnet/tipc/Kconfig-25-\tbool \"InfiniBand media type support\"\n--\nnet/tipc/Kconfig-29-\t  IP-over-InfiniBand devices.\nnet/tipc/Kconfig:30:config TIPC_MEDIA_UDP\nnet/tipc/Kconfig-31-\tbool \"IP/UDP media type support\"\n--\nnet/tipc/Kconfig-37-\nnet/tipc/Kconfig:38:config TIPC_CRYPTO\nnet/tipc/Kconfig-39-\tbool \"TIPC encryption support\"\n--\nnet/tipc/Kconfig-52-\nnet/tipc/Kconfig:53:config TIPC_DIAG\nnet/tipc/Kconfig-54-\ttristate \"TIPC: socket monitoring interface\"\n"
}

5/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 11462
							output: 33
							thoughts: 26
						

Thoughts:
Okay, here's my take on those lines from `net/tipc/Kconfig`, summarized from the perspective of someone familiar with the codebase:

**Reviewing the TIPC Configuration Options**

Alright, let's dive into the `net/tipc/Kconfig` file, specifically the first 25 lines. I need to refresh my memory on what options are presented for the TIPC (Transparent Inter-Process Communication) configuration. I'll use `read-file` to get the content and jog my memory of the general layout of those early lines. I suspect this initial section probably deals with the core enabling or disabling of TIPC as a whole and maybe some of the basic, overarching features. I'm expecting to see things like the main module selection and perhaps some platform or architecture-specific flags that have to come before more granular settings. My instinct is that lines 1-25 will set the stage for the more detailed configuration options that follow, so I need to understand this part first to get the full picture. Let's see what's what.



6/2 2026/10/05 04:36 tool read-file
0m Args:
{
  "File": "net/tipc/Kconfig",
  "FirstLine": 1,
  "LineCount": 25
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# TIPC configuration\n   4:\t#\n   5:\t\n   6:\tmenuconfig TIPC\n   7:\t\ttristate \"The TIPC Protocol\"\n   8:\t\tdepends on INET\n   9:\t\thelp\n  10:\t\t  The Transparent Inter Process Communication (TIPC) protocol is\n  11:\t\t  specially designed for intra cluster communication. This protocol\n  12:\t\t  originates from Ericsson where it has been used in carrier grade\n  13:\t\t  cluster applications for many years.\n  14:\t\n  15:\t\t  For more information about TIPC, see http://tipc.sourceforge.net.\n  16:\t\n  17:\t\t  This protocol support is also available as a module ( = code which\n  18:\t\t  can be inserted in and removed from the running kernel whenever you\n  19:\t\t  want). The module will be called tipc. If you want to compile it\n  20:\t\t  as a module, say M here and read \u003cfile:Documentation/kbuild/modules.rst\u003e.\n  21:\t\n  22:\t\t  If in doubt, say N.\n  23:\t\n  24:\tconfig TIPC_MEDIA_IB\n  25:\t\tbool \"InfiniBand media type support\"\n"
}

7/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 12088
							output: 32
							thoughts: 14
						

Thoughts:
Okay, let's dive into this. Here's my take on those initial thoughts:

**Analyzing the net/tipc/Makefile**

Alright, my internal radar's up. The directive to examine the `Makefile` within the `net/tipc/` directory immediately brings several things to mind. I'm thinking, "Okay, `net/tipc/` – that's the kernel's Transparent Inter-Process Communication code, right? So, any `Makefile` in *there* is going to be crucial for building and linking those specific network modules and possibly related utilities. Let's see what the build process looks like." I'm mentally parsing the possibilities: dependencies, compilation flags, module targets… the whole orchestration of building the TIPC subsystem. This is the place to start getting a high-level understanding of its compilation and linking procedures. It's time to dig into the details and reverse engineer the build process for this critical piece of network infrastructure. My focus will be on identifying the major components built, how they interact, and any clever or unusual build techniques employed.



8/2 2026/10/05 04:36 tool read-file
0m Args:
{
  "File": "net/tipc/Makefile",
  "FirstLine": 1,
  "LineCount": 30
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0\n   2:\t#\n   3:\t# Makefile for the Linux TIPC layer\n   4:\t#\n   5:\t\n   6:\tobj-$(CONFIG_TIPC) := tipc.o\n   7:\t\n   8:\ttipc-y\t+= addr.o bcast.o bearer.o \\\n   9:\t\t   core.o link.o discover.o msg.o  \\\n  10:\t\t   name_distr.o  subscr.o monitor.o name_table.o net.o  \\\n  11:\t\t   netlink.o netlink_compat.o node.o socket.o eth_media.o \\\n  12:\t\t   topsrv.o group.o trace.o\n  13:\t\n  14:\tCFLAGS_trace.o += -I$(src)\n  15:\t\n  16:\ttipc-$(CONFIG_TIPC_MEDIA_UDP)\t+= udp_media.o\n  17:\ttipc-$(CONFIG_TIPC_MEDIA_IB)\t+= ib_media.o\n  18:\ttipc-$(CONFIG_SYSCTL)\t\t+= sysctl.o\n  19:\ttipc-$(CONFIG_TIPC_CRYPTO)\t+= crypto.o\n  20:\t\n  21:\tobj-$(CONFIG_TIPC_DIAG)\t+= tipc_diag.o\n  22:\ttipc_diag-y\t+= diag.o\n"
}

9/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 12738
							output: 39
							thoughts: 2210
						

Thoughts:
**Analyzing the TIPC Lock Reordering Patch**

Okay, so I'm looking at these modified TIPC files – `name_distr.o`, `name_table.o`, `net.o`, `node.o`, and `socket.o` – all part of `tipc-y` and controlled by `CONFIG_TIPC`, which in turn depends on `CONFIG_INET`. I'm going to examine this patch to see what problem it's addressing, especially from a concurrency point of view.

First off, it seems like the issue is with lock ordering, potential deadlocks, and race conditions, mainly within the name table and publication/withdrawal mechanisms. I'm focusing on `tipc_node_write_unlock`, `tipc_nametbl_publish`, `tipc_nametbl_withdraw`, and the functions they call. Previously, there were potential lock inversions. For instance, `tipc_nametbl_publish` and `tipc_nametbl_withdraw` used to call `tipc_node_broadcast` directly. That's a red flag! Also `tipc_node_subscribe` was looking up `tipc_node_find(net, addr)` and taking `tipc_node_write_lock(n)`!

The crux of the problem seems to be that while a `node` lock was held, other locks, such as the name table lock (`tn->nametbl_lock`) might be taken, or could be taken, leading to potential lock ordering violations. For example, `tipc_update_nametbl()` called from `tipc_named_rcv()`, which is called from inside `tipc_rcv()` and `tipc_node_bc_rcv()`, used to call `tipc_node_subscribe()` which could take a lock. Also `publ_purge()` is called in `tipc_publ_notify()` which is called inside `tipc_node_write_unlock()` with `n->lock` held, and in `tipc_publ_purge()` calls `spin_lock_bh(&tn->nametbl_lock)`!

Now, this patch changes everything. `tipc_nametbl_publish` and `tipc_nametbl_withdraw` no longer call `tipc_node_broadcast` directly. Instead, they produce `skb` and `rc_dests` and these are broadcast *after* all the locks are dropped. Crucially, the calls to `tipc_nametbl_publish`, `tipc_nametbl_withdraw`, `tipc_publ_notify`, and `tipc_named_node_up` are *now* performed while holding the `n->lock`. `tipc_named_node_up` now populates an `xmitq` that is processed later, after the `write_unlock_bh(&n->lock)`. Furthermore, `tipc_node_subscribe` and `tipc_node_unsubscribe` are now more lightweight operations just adding or removing from a list. The code is much easier to understand.

However, I'm noticing a potential issue. If both `TIPC_NOTIFY_LINK_UP` and `TIPC_NOTIFY_LINK_DOWN` are set in `n->action_flags`, the `skb` generated by `tipc_nametbl_publish` would be overwritten by the `skb` generated by `tipc_nametbl_withdraw`, resulting in a memory leak. I'll need to confirm that that's a real issue.

Finally, the locking order has changed.  `n->lock` is now held while acquiring `tn->nametbl_lock`, which in the original code, was likely where the deadlock would occur. Let me also check `tipc_named_rcv` to be completely certain.



10/2 2026/10/05 04:36 tool read-file
0m Args:
{
  "File": "net/tipc/name_distr.c",
  "FirstLine": 370,
  "LineCount": 40
}

Results:
{
  "Contents": " 370:\t * @namedq: queue to receive from\n 371:\t * @rcv_nxt: store last received seqno here\n 372:\t * @open: last bulk msg was received (FIXME)\n 373:\t */\n 374:\tvoid tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,\n 375:\t\t\t    struct list_head *publ_list, u16 *rcv_nxt, bool *open)\n 376:\t{\n 377:\t\tstruct tipc_net *tn = tipc_net(net);\n 378:\t\tstruct distr_item *item;\n 379:\t\tstruct tipc_msg *hdr;\n 380:\t\tstruct sk_buff *skb;\n 381:\t\tu32 count, node;\n 382:\t\n 383:\t\tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n 384:\t\twhile ((skb = tipc_named_dequeue(namedq, rcv_nxt, open))) {\n 385:\t\t\thdr = buf_msg(skb);\n 386:\t\t\tnode = msg_orignode(hdr);\n 387:\t\t\titem = (struct distr_item *)msg_data(hdr);\n 388:\t\t\tcount = msg_data_sz(hdr) / ITEM_SIZE;\n 389:\t\t\twhile (count--) {\n 390:\t\t\t\ttipc_update_nametbl(net, item, node,\n 391:\t\t\t\t\t\t    msg_type(hdr), publ_list);\n 392:\t\t\t\titem++;\n 393:\t\t\t}\n 394:\t\t\tkfree_skb(skb);\n 395:\t\t}\n 396:\t\tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n 397:\t}\n 398:\t\n 399:\t/**\n 400:\t * tipc_named_reinit - re-initialize local publications\n 401:\t * @net: the associated network namespace\n 402:\t *\n 403:\t * This routine is called whenever TIPC networking is enabled.\n 404:\t * All name table entries published by this node are updated to reflect\n 405:\t * the node's new network address.\n 406:\t */\n 407:\tvoid tipc_named_reinit(struct net *net)\n 408:\t{\n 409:\t\tstruct name_table *nt = tipc_name_table(net);\n"
}

11/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16483
							output: 26
							thoughts: 336
						

Thoughts:
**My Assessment of the TIPC Lock Order Issue**

Okay, so here's the situation I'm seeing: `tipc_named_rcv` is acquiring `tn->nametbl_lock` *while* `n->lock` is already held. The code reveals this in functions like `tipc_rcv` and `tipc_node_bc_rcv`, specifically:

```c
tipc_node_write_lock(n);
tipc_named_rcv(net, &n->bc_entry.namedq, ...);
tipc_node_write_unlock_fast(n);
```

Essentially, the lock order is `n->lock` followed by `tn->nametbl_lock`. This refactoring touches a lot of critical areas including the locking order itself, distribution of name table entries, how sockets are published and withdrawn, packet reception, and node notification. This is substantial.

The reachability of this is high, especially in virtualized environments. Think about it: TIPC sockets can be opened by unprivileged users in user namespaces, or by root or netadmin users. Plus, TIPC frequently runs over loopback, UDP, and dummy net devices in syzkaller.

Given all this, I'm confident that this is a critical spot for fuzzing. We need to be aggressive. This absolutely warrants our attention (`WorthFuzzing=true`).

Now, we need to get practical.

1.  **Essential Configurations:** We need to figure out the minimal required kernel configurations for TIPC. What's required to actually trigger this issue? Let's start by looking at `net/tipc/Kconfig`. `TIPC` obviously depends on `INET`, but are there other dependencies that could influence the behavior of the locking order? Let's check `net/tipc/Kconfig` again, and maybe even `grep` the kernel tree for more dependencies to be sure we're covered.



12/2 2026/10/05 04:36 tool grepper
0m Args:
{
  "Expression": "depends on.*TIPC",
  "PathPrefix": "net"
}

Results:
{
  "Output": "net/tipc/Kconfig=24=config TIPC_MEDIA_IB\nnet/tipc/Kconfig-25-\tbool \"InfiniBand media type support\"\nnet/tipc/Kconfig:26:\tdepends on TIPC \u0026\u0026 INFINIBAND_IPOIB\nnet/tipc/Kconfig-27-\thelp\n--\nnet/tipc/Kconfig=30=config TIPC_MEDIA_UDP\nnet/tipc/Kconfig-31-\tbool \"IP/UDP media type support\"\nnet/tipc/Kconfig:32:\tdepends on TIPC\nnet/tipc/Kconfig-33-\tselect NET_UDP_TUNNEL\n--\nnet/tipc/Kconfig=38=config TIPC_CRYPTO\nnet/tipc/Kconfig-39-\tbool \"TIPC encryption support\"\nnet/tipc/Kconfig:40:\tdepends on TIPC\nnet/tipc/Kconfig-41-\tselect CRYPTO\n--\nnet/tipc/Kconfig=53=config TIPC_DIAG\nnet/tipc/Kconfig-54-\ttristate \"TIPC: socket monitoring interface\"\nnet/tipc/Kconfig:55:\tdepends on TIPC\nnet/tipc/Kconfig-56-\tdefault y\n"
}

13/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 17584
							output: 37
							thoughts: 815
						

Thoughts:
**Analyzing TIPC Configuration and Relevant Symbols**

Okay, so I'm focusing on the TIPC configuration and its dependencies within the Linux network stack. My initial thought is that `TIPC` relies heavily on `INET`, which is a standard component (`CONFIG_INET`). Therefore, enabling `TIPC` should be the primary configuration step. While I *could* include `INET` explicitly, or just `TIPC` on its own, `INET` is already the default, so there's not much point.

Now, I need to pinpoint the critical functions affected by `TIPC` to zero in on the relevant `FocusSymbols`. Let's start by listing the modified functions. It looks like the following files have been modified:

1.  In `net/tipc/name_distr.c`, I see:
    *   `tipc_named_node_up`
    *   `tipc_publ_purge` (static)
    *   `tipc_publ_notify`
    *   `tipc_update_nametbl` (static)
    *   `tipc_named_rcv`

2.  In `net/tipc/name_table.c`:
    *   `tipc_nametbl_publish`
    *   `tipc_nametbl_withdraw`

3.  In `net/tipc/net.c`:
    *   `tipc_net_finalize` (static, called by `tipc_net_finalize_work`)

4.  In `net/tipc/node.c`:
    *   `tipc_node_write_unlock`
    *   `tipc_node_subscribe`
    *   `tipc_node_unsubscribe`
    *   `tipc_node_bc_rcv`
    *   `tipc_rcv`

5.  In `net/tipc/socket.c`:
    *   `tipc_sk_publish` (static, called by `tipc_sk_bind`, `tipc_sk_join`, etc.)
    *   `tipc_sk_withdraw` (static, called by `tipc_sk_withdraw`, `tipc_sk_leave`, socket close/release)

Next, I need to filter these functions. My goal is to identify which of them are *non-static* and *not ubiquitous*, which will narrow down the relevant symbols. Let's see...

I'll specifically check `tipc_named_node_up`, `tipc_publ_notify`, `tipc_named_rcv`, `tipc_nametbl_publish`, `tipc_nametbl_withdraw`, `tipc_node_subscribe`, `tipc_node_unsubscribe`, `tipc_node_write_unlock`, `tipc_rcv`, and `tipc_node_bc_rcv`.

Hold on, I need to double-check `tipc_node_write_unlock` - I have to see if that's actually static. Let me see... in `net/tipc/node.c`: Yup, it's declared `static void tipc_node_write_unlock(struct tipc_node *n)`. Okay, so `tipc_node_write_unlock` is static and can be removed from this consideration.

Now let's check the remaining symbols: `tipc_rcv`: `void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)` -> This one's exported/global!
`tipc_nametbl_publish` -> That's also exported/global!
`tipc_nametbl_withdraw` -> Exported/global!
`tipc_named_rcv` -> Exported/global!
`tipc_publ_notify` -> Exported/global!
`tipc_named_node_up` -> Exported/global!
`tipc_node_subscribe` -> Exported/global!
`tipc_node_unsubscribe` -> Exported/global!

I'll have to investigate *which* socket entrypoints call `tipc_sk_publish` and `tipc_sk_withdraw`. To do this, I will need to look through `net/tipc/socket.c`, specifically around lines 2900-3050, to inspect socket entrypoints to better understand the symbol's usage.



14/2 2026/10/05 04:36 tool read-file
0m Args:
{
  "File": "net/tipc/socket.c",
  "FirstLine": 2920,
  "LineCount": 90
}

Results:
{
  "Contents": "2920:\t\t\treturn -EADDRINUSE;\n2921:\t\tskaddr.ref = tsk-\u003eportid;\n2922:\t\tskaddr.node = tipc_own_addr(net);\n2923:\t\tp = tipc_nametbl_publish(net, ua, \u0026skaddr, key, \u0026skb, \u0026rc_dests);\n2924:\t\tif (unlikely(!p))\n2925:\t\t\treturn -EINVAL;\n2926:\t\n2927:\t\tif (skb)\n2928:\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n2929:\t\n2930:\t\tlist_add(\u0026p-\u003ebinding_sock, \u0026tsk-\u003epublications);\n2931:\t\ttsk-\u003epub_count++;\n2932:\t\ttsk-\u003epublished = true;\n2933:\t\treturn 0;\n2934:\t}\n2935:\t\n2936:\tstatic int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n2937:\t{\n2938:\t\tstruct net *net = sock_net(\u0026tsk-\u003esk);\n2939:\t\tstruct publication *safe, *p;\n2940:\t\tstruct tipc_uaddr _ua;\n2941:\t\tstruct sk_buff *skb;\n2942:\t\tint rc = -EINVAL;\n2943:\t\tu32 rc_dests;\n2944:\t\n2945:\t\tlist_for_each_entry_safe(p, safe, \u0026tsk-\u003epublications, binding_sock) {\n2946:\t\t\tskb = NULL;\n2947:\t\t\tif (!ua) {\n2948:\t\t\t\ttipc_uaddr(\u0026_ua, TIPC_SERVICE_RANGE, p-\u003escope,\n2949:\t\t\t\t\t   p-\u003esr.type, p-\u003esr.lower, p-\u003esr.upper);\n2950:\t\t\t\ttipc_nametbl_withdraw(net, \u0026_ua, \u0026p-\u003esk, p-\u003ekey,\n2951:\t\t\t\t\t\t      \u0026skb, \u0026rc_dests);\n2952:\t\t\t\tif (skb)\n2953:\t\t\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n2954:\t\t\t\tcontinue;\n2955:\t\t\t}\n2956:\t\t\t/* Unbind specific publication */\n2957:\t\t\tif (p-\u003escope != ua-\u003escope)\n2958:\t\t\t\tcontinue;\n2959:\t\t\tif (p-\u003esr.type != ua-\u003esr.type)\n2960:\t\t\t\tcontinue;\n2961:\t\t\tif (p-\u003esr.lower != ua-\u003esr.lower)\n2962:\t\t\t\tcontinue;\n2963:\t\t\tif (p-\u003esr.upper != ua-\u003esr.upper)\n2964:\t\t\t\tbreak;\n2965:\t\t\ttipc_nametbl_withdraw(net, ua, \u0026p-\u003esk, p-\u003ekey, \u0026skb, \u0026rc_dests);\n2966:\t\t\tif (skb)\n2967:\t\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n2968:\t\t\trc = 0;\n2969:\t\t\tbreak;\n2970:\t\t}\n2971:\t\tif (list_empty(\u0026tsk-\u003epublications)) {\n2972:\t\t\ttsk-\u003epublished = 0;\n2973:\t\t\trc = 0;\n2974:\t\t}\n2975:\t\treturn rc;\n2976:\t}\n2977:\t\n2978:\t/* tipc_sk_reinit: set non-zero address in all existing sockets\n2979:\t *                 when we go from standalone to network mode.\n2980:\t */\n2981:\tvoid tipc_sk_reinit(struct net *net)\n2982:\t{\n2983:\t\tstruct tipc_net *tn = net_generic(net, tipc_net_id);\n2984:\t\tstruct rhashtable_iter iter;\n2985:\t\tstruct tipc_sock *tsk;\n2986:\t\tstruct tipc_msg *msg;\n2987:\t\n2988:\t\trhashtable_walk_enter(\u0026tn-\u003esk_rht, \u0026iter);\n2989:\t\n2990:\t\tdo {\n2991:\t\t\trhashtable_walk_start(\u0026iter);\n2992:\t\n2993:\t\t\twhile ((tsk = rhashtable_walk_next(\u0026iter)) \u0026\u0026 !IS_ERR(tsk)) {\n2994:\t\t\t\tsock_hold(\u0026tsk-\u003esk);\n2995:\t\t\t\trhashtable_walk_stop(\u0026iter);\n2996:\t\t\t\tlock_sock(\u0026tsk-\u003esk);\n2997:\t\t\t\tmsg = \u0026tsk-\u003ephdr;\n2998:\t\t\t\tmsg_set_prevnode(msg, tipc_own_addr(net));\n2999:\t\t\t\tmsg_set_orignode(msg, tipc_own_addr(net));\n3000:\t\t\t\trelease_sock(\u0026tsk-\u003esk);\n3001:\t\t\t\trhashtable_walk_start(\u0026iter);\n3002:\t\t\t\tsock_put(\u0026tsk-\u003esk);\n3003:\t\t\t}\n3004:\t\n3005:\t\t\trhashtable_walk_stop(\u0026iter);\n3006:\t\t} while (tsk == ERR_PTR(-EAGAIN));\n3007:\t\n3008:\t\trhashtable_walk_exit(\u0026iter);\n3009:\t}\n"
}

15/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 20840
							output: 37
							thoughts: 25
						

Thoughts:
Okay, let's dive into this code.

**Investigating `tipc_sk_publish` and `tipc_sk_withdraw` Call Sites**

Right, so I need to understand the behavior of `tipc_sk_publish` and `tipc_sk_withdraw`. Where are these functions actually being *used*? I need to trace their call sites to get a grasp on their operational context. It's the only way to really understand their purpose and potential impact on the system. Time to crack open the source and start digging. Let's see... I'll need to use some search tools to efficiently identify every instance where these functions are invoked. From there, I can begin to analyze the surrounding code to determine how data is passed, what dependencies are involved, and what the overall logic is within these function calls. This should be a fairly straightforward exercise; just need to stay focused and methodical. Let's get to it.



16/2 2026/10/05 04:36 tool grepper
0m Args:
{
  "Expression": "tipc_sk_(publish|withdraw)",
  "PathPrefix": "net/tipc/socket.c"
}

Results:
{
  "Output": "net/tipc/socket.c=150=static void tipc_sk_timeout(struct timer_list *t);\nnet/tipc/socket.c:151:static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua);\nnet/tipc/socket.c:152:static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua);\nnet/tipc/socket.c-153-static int tipc_sk_leave(struct tipc_sock *tsk);\n--\nnet/tipc/socket.c=626=static int tipc_release(struct socket *sock)\n--\nnet/tipc/socket.c-644-\ttipc_sk_leave(tsk);\nnet/tipc/socket.c:645:\ttipc_sk_withdraw(tsk, NULL);\nnet/tipc/socket.c-646-\t__skb_queue_purge(\u0026tsk-\u003emc_method.deferredq);\n--\nnet/tipc/socket.c=676=static int __tipc_bind(struct socket *sock, struct sockaddr *skaddr, int alen)\n--\nnet/tipc/socket.c-682-\tif (unlikely(!alen))\nnet/tipc/socket.c:683:\t\treturn tipc_sk_withdraw(tsk, NULL);\nnet/tipc/socket.c-684-\n--\nnet/tipc/socket.c-700-\tif (unbind)\nnet/tipc/socket.c:701:\t\treturn tipc_sk_withdraw(tsk, ua);\nnet/tipc/socket.c:702:\treturn tipc_sk_publish(tsk, ua);\nnet/tipc/socket.c-703-}\n--\nnet/tipc/socket.c=2870=static void tipc_sk_timeout(struct timer_list *t)\n--\nnet/tipc/socket.c-2906-\nnet/tipc/socket.c:2907:static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua)\nnet/tipc/socket.c-2908-{\n--\nnet/tipc/socket.c-2935-\nnet/tipc/socket.c:2936:static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\nnet/tipc/socket.c-2937-{\n--\nnet/tipc/socket.c=3084=static int tipc_sk_join(struct tipc_sock *tsk, struct tipc_group_req *mreq)\n--\nnet/tipc/socket.c-3109-\ttipc_nametbl_build_group(net, grp, \u0026ua);\nnet/tipc/socket.c:3110:\trc = tipc_sk_publish(tsk, \u0026ua);\nnet/tipc/socket.c-3111-\tif (rc) {\n--\nnet/tipc/socket.c=3123=static int tipc_sk_leave(struct tipc_sock *tsk)\n--\nnet/tipc/socket.c-3136-\ttsk-\u003egroup = NULL;\nnet/tipc/socket.c:3137:\ttipc_sk_withdraw(tsk, \u0026ua);\nnet/tipc/socket.c-3138-\treturn 0;\n"
}

17/2 2026/10/05 04:36 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 21976
							output: 216
							thoughts: 622
						

Thoughts:
**My Assessment of the TIPC Refactoring Patch**

Okay, let's break this down. From what I'm seeing, `tipc_sk_publish` and `tipc_sk_withdraw` are crucial, and are called during the binding process (`tipc_bind`), socket release, and `setsockopt` operations (join/leave). That's my starting point. I've got a good grasp on the core interactions of these functions.

Now, let's dig into the symbols. I need to confirm what's *actually* exposed. Looking at `name_table.h`, `name_distr.h`, and `node.h`, I see `tipc_nametbl_publish`, `tipc_nametbl_withdraw`, `tipc_named_node_up`, `tipc_named_rcv`, `tipc_publ_notify`, `tipc_node_subscribe`, `tipc_node_unsubscribe`, and `tipc_rcv` are all non-static, with prototypes in header files. Excellent. That confirms these are all entry points to probe.

The crucial question is how *ubiquitous* these functions are. They're specifically related to TIPC: name table distribution, publication, node operations, and receiving packets. This makes them ideal targets because they’re not generic kernel functions. They are specific to the functionality being modified.

Next, the configs: `TIPC` itself depends on `INET`. Okay, standard stuff. Let's make sure I didn't miss anything. Nope, `NET`, `INET`, and `TIPC`. Good. This looks straightforward.

Now, let's recap the whole package and solidify the reasoning. The patch refactors TIPC, specifically how it handles name table publishing, withdrawal, and node subscriptions. The key changes are how locking and packet transmission are handled. It looks like `tipc_node_broadcast` is no longer called with internal locks, `tipc_named_rcv` is now under a lock, and publications/withdrawals defer transmissions now. This impacts concurrency, locking, and packet processing within TIPC. These changes are reachable through AF_TIPC socket operations and TIPC network traffic, so it's a good target for fuzzing. Given the changes to locking and transmission semantics, fuzzing is essential to look for any deadlocks, memory leaks, or race conditions. All of this makes the patch a prime candidate for fuzzing.

Alright, I'm confident. Time to call it in.



18/2 2026/10/05 04:36 tool set-results
0m Args:
{
  "EnableConfigs": [
    "INET",
    "TIPC"
  ],
  "FocusSymbols": [
    "tipc_nametbl_publish",
    "tipc_nametbl_withdraw",
    "tipc_named_node_up",
    "tipc_publ_notify",
    "tipc_named_rcv",
    "tipc_node_subscribe",
    "tipc_node_unsubscribe",
    "tipc_rcv"
  ],
  "Reasoning": "The patch modifies core TIPC name table distribution, publication, and node subscription logic. It refactors locking patterns and postpones packet broadcast/transmission to be performed outside of locks, altering the interaction between node write locks and name table locks during message reception and publication updates. This reachable networking code can be exercised via AF_TIPC sockets and TIPC packet reception in virtualized environments, making it a prime candidate for fuzzing to discover potential race conditions, deadlocks, or skb leaks.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "INET",
    "TIPC"
  ],
  "FocusSymbols": [
    "tipc_nametbl_publish",
    "tipc_nametbl_withdraw",
    "tipc_named_node_up",
    "tipc_publ_notify",
    "tipc_named_rcv",
    "tipc_node_subscribe",
    "tipc_node_unsubscribe",
    "tipc_rcv"
  ],
  "Reasoning": "The patch modifies core TIPC name table distribution, publication, and node subscription logic. It refactors locking patterns and postpones packet broadcast/transmission to be performed outside of locks, altering the interaction between node write locks and name table locks during message reception and publication updates. This reachable networking code can be exercised via AF_TIPC sockets and TIPC packet reception in virtualized environments, making it a prime candidate for fuzzing to discover potential race conditions, deadlocks, or skb leaks.",
  "WorthFuzzing": true
}

19/1 2026/10/05 04:36 action If
1m Args:
{
  "WorthFuzzing": true
}

Results:
null

20/2 2026/10/05 04:36 agent kmsan-evaluator
1m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch refactors TIPC locking and publication management to avoid deadlocks and race conditions between node locks (`n-\u003elock`) and the name table lock (`tn-\u003enametbl_lock`). Specifically:\n- `tipc_named_node_up` and `tipc_nametbl_publish`/`tipc_nametbl_withdraw` no longer broadcast or transmit packets directly under locks; instead, they defer transmission to callers by passing back an skb or appending to an skb queue (`xmitq`).\n- `tipc_node_subscribe` and `tipc_node_unsubscribe` are simplified to operate directly on the publication list under callers' existing locks.\n- In `tipc_node_write_unlock`, node notification handlers are called with appropriate locking, and outgoing skbs/broadcasts are transmitted after unlocking `n-\u003elock`.\n\nAll newly introduced local variables (e.g., `skb = NULL`, queue head initialized via `__skb_queue_head_init`, `rc_dests` populated when publications are generated) are initialized before use. There are no allocations of uninitialized memory, no structures copied to user space, and no branching on uninitialized data. Any potential bugs introduced by these changes are concurrency, locking (deadlock/lock inversion), or object lifecycle/use-after-free issues, all of which are covered by LOCKDEP and KASAN. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit 51b2d9d0aa11997997465cc9c8acc3c045b78800
Author: syz-cluster <triage@syzkaller.com>
Date:   Mon Oct 5 04:36:06 2026 +0000

    syz-cluster: applied patch under review

diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
index ba4f4906e13b7..cf5125212521c 100644
--- a/net/tipc/name_distr.c
+++ b/net/tipc/name_distr.c
@@ -202,8 +202,10 @@ static void named_distribute(struct net *net, struct sk_buff_head *list,
  * @net: the associated network namespace
  * @dnode: destination node
  * @capabilities: peer node's capabilities
+ * @xmitq: list of skbs need to be sent
  */
-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,
+			struct sk_buff_head *xmitq)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
@@ -218,8 +220,7 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
 	spin_unlock_bh(&tn->nametbl_lock);
 
 	read_lock_bh(&nt->cluster_scope_lock);
-	named_distribute(net, &head, dnode, &nt->cluster_scope, seqno);
-	tipc_node_xmit(net, &head, dnode, 0);
+	named_distribute(net, xmitq, dnode, &nt->cluster_scope, seqno);
 	read_unlock_bh(&nt->cluster_scope_lock);
 }
 
@@ -227,12 +228,11 @@ void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities)
  * tipc_publ_purge - remove publication associated with a failed node
  * @net: the associated network namespace
  * @p: the publication to remove
- * @addr: failed node's address
  *
  * Invoked for each publication issued by a newly failed node.
  * Removes publication structure from name table & deletes it.
  */
-static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)
+static void tipc_publ_purge(struct net *net, struct publication *p)
 {
 	struct tipc_net *tn = tipc_net(net);
 	struct publication *_p;
@@ -243,14 +243,14 @@ static void tipc_publ_purge(struct net *net, struct publication *p, u32 addr)
 	spin_lock_bh(&tn->nametbl_lock);
 	_p = tipc_nametbl_remove_publ(net, &ua, &p->sk, p->key);
 	if (_p)
-		tipc_node_unsubscribe(net, &_p->binding_node, addr);
+		tipc_node_unsubscribe(&_p->binding_node);
 	spin_unlock_bh(&tn->nametbl_lock);
 	if (_p)
 		kfree_rcu(_p, rcu);
 }
 
 void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
-		      u32 addr, u16 capabilities)
+		      u16 capabilities)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
@@ -258,7 +258,7 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
 	struct publication *publ, *tmp;
 
 	list_for_each_entry_safe(publ, tmp, nsub_list, binding_node)
-		tipc_publ_purge(net, publ, addr);
+		tipc_publ_purge(net, publ);
 	spin_lock_bh(&tn->nametbl_lock);
 	if (!(capabilities & TIPC_NAMED_BCAST))
 		nt->rc_dests--;
@@ -277,7 +277,8 @@ void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
  * Return: the publication item if successful, otherwise NULL.
  */
 static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
-				u32 node, u32 dtype)
+				u32 node, u32 dtype,
+				struct list_head *publ_list)
 {
 	struct publication *p = NULL;
 	u32 lower = ntohl(i->lower);
@@ -301,13 +302,13 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
 	if (dtype == PUBLICATION) {
 		p = tipc_nametbl_insert_publ(net, &ua, &sk, key);
 		if (p) {
-			tipc_node_subscribe(net, &p->binding_node, node);
+			tipc_node_subscribe(&p->binding_node, publ_list);
 			return true;
 		}
 	} else if (dtype == WITHDRAWAL) {
 		p = tipc_nametbl_remove_publ(net, &ua, &sk, key);
 		if (p) {
-			tipc_node_unsubscribe(net, &p->binding_node, node);
+			tipc_node_unsubscribe(&p->binding_node);
 			kfree_rcu(p, rcu);
 			return true;
 		}
@@ -371,7 +372,7 @@ static struct sk_buff *tipc_named_dequeue(struct sk_buff_head *namedq,
  * @open: last bulk msg was received (FIXME)
  */
 void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
-		    u16 *rcv_nxt, bool *open)
+		    struct list_head *publ_list, u16 *rcv_nxt, bool *open)
 {
 	struct tipc_net *tn = tipc_net(net);
 	struct distr_item *item;
@@ -386,7 +387,8 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
 		item = (struct distr_item *)msg_data(hdr);
 		count = msg_data_sz(hdr) / ITEM_SIZE;
 		while (count--) {
-			tipc_update_nametbl(net, item, node, msg_type(hdr));
+			tipc_update_nametbl(net, item, node,
+					    msg_type(hdr), publ_list);
 			item++;
 		}
 		kfree_skb(skb);
diff --git a/net/tipc/name_distr.h b/net/tipc/name_distr.h
index c677f6f082dfb..14c008ab8644e 100644
--- a/net/tipc/name_distr.h
+++ b/net/tipc/name_distr.h
@@ -69,11 +69,12 @@ struct distr_item {
 
 struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ);
 struct sk_buff *tipc_named_withdraw(struct net *net, struct publication *publ);
-void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities);
+void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities,
+			struct sk_buff_head *xmitq);
 void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq,
-		    u16 *rcv_nxt, bool *open);
+		    struct list_head *publ_list, u16 *rcv_nxt, bool *open);
 void tipc_named_reinit(struct net *net);
 void tipc_publ_notify(struct net *net, struct list_head *nsub_list,
-		      u32 addr, u16 capabilities);
+		      u16 capabilities);
 
 #endif
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 6fda36ab17669..da306d178d564 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -760,15 +760,14 @@ void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
 /* tipc_nametbl_publish - add service binding to name table
  */
 struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
-					 struct tipc_socket_addr *sk, u32 key)
+					 struct tipc_socket_addr *sk, u32 key,
+					 struct sk_buff **skb, u32 *rc_dests)
 {
 	struct name_table *nt = tipc_name_table(net);
 	u32 max_user_pub = TIPC_MAX_PUBL - 1;
 	struct tipc_net *tn = tipc_net(net);
 	struct publication *p = NULL;
-	struct sk_buff *skb = NULL;
 	bool protocol_type = false;
-	u32 rc_dests;
 
 	if (ua->sr.type == TIPC_NODE_STATE || ua->sr.type == TIPC_LINK_STATE ||
 	    ua->sr.type == TIPC_TOP_SRV)
@@ -797,14 +796,12 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
 		 */
 		if (!protocol_type)
 			nt->local_publ_count++;
-		skb = tipc_named_publish(net, p);
+		*skb = tipc_named_publish(net, p);
 	}
-	rc_dests = nt->rc_dests;
+	*rc_dests = nt->rc_dests;
 exit:
 	spin_unlock_bh(&tn->nametbl_lock);
 
-	if (skb)
-		tipc_node_broadcast(net, skb, rc_dests);
 	return p;
 
 }
@@ -815,15 +812,16 @@ struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
  * @ua: service address/range being unbound
  * @sk: address of the socket being unbound from
  * @key: target publication key
+ * skb: name distribution message needs to be sent
+ * rc_dests: the number of replicast destinations
  */
 void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
-			   struct tipc_socket_addr *sk, u32 key)
+			   struct tipc_socket_addr *sk, u32 key,
+			   struct sk_buff **skb, u32 *rc_dests)
 {
 	struct name_table *nt = tipc_name_table(net);
 	struct tipc_net *tn = tipc_net(net);
-	struct sk_buff *skb = NULL;
 	struct publication *p;
-	u32 rc_dests;
 
 	spin_lock_bh(&tn->nametbl_lock);
 
@@ -833,15 +831,12 @@ void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
 		    p->sr.type != TIPC_LINK_STATE &&
 		    p->sr.type != TIPC_TOP_SRV)
 			nt->local_publ_count--;
-		skb = tipc_named_withdraw(net, p);
+		*skb = tipc_named_withdraw(net, p);
 		list_del_init(&p->binding_sock);
 		kfree_rcu(p, rcu);
 	}
-	rc_dests = nt->rc_dests;
+	*rc_dests = nt->rc_dests;
 	spin_unlock_bh(&tn->nametbl_lock);
-
-	if (skb)
-		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 /**
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
index 7ff6eeebaae64..6cbc9da17464b 100644
--- a/net/tipc/name_table.h
+++ b/net/tipc/name_table.h
@@ -126,9 +126,11 @@ bool tipc_nametbl_lookup_group(struct net *net, struct tipc_uaddr *ua,
 void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,
 			      struct tipc_uaddr *ua);
 struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,
-					 struct tipc_socket_addr *sk, u32 key);
+					 struct tipc_socket_addr *sk, u32 key,
+					 struct sk_buff **skb, u32 *rc_dests);
 void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,
-			   struct tipc_socket_addr *sk, u32 key);
+			   struct tipc_socket_addr *sk, u32 key,
+			   struct sk_buff **skb, u32 *rc_dests);
 struct publication *tipc_nametbl_insert_publ(struct net *net,
 					     struct tipc_uaddr *ua,
 					     struct tipc_socket_addr *sk,
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 7e65d0b0c4a8d..1e445c5abc0f5 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -125,9 +125,11 @@ int tipc_net_init(struct net *net, u8 *node_id, u32 addr)
 
 static void tipc_net_finalize(struct net *net, u32 addr)
 {
-	struct tipc_net *tn = tipc_net(net);
 	struct tipc_socket_addr sk = {0, addr};
+	struct tipc_net *tn = tipc_net(net);
+	struct sk_buff *skb = NULL;
 	struct tipc_uaddr ua;
+	u32 rc_dests;
 
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_CLUSTER_SCOPE,
 		   TIPC_NODE_STATE, addr, addr);
@@ -138,7 +140,9 @@ static void tipc_net_finalize(struct net *net, u32 addr)
 	tipc_named_reinit(net);
 	tipc_sk_reinit(net);
 	tipc_mon_reinit_self(net);
-	tipc_nametbl_publish(net, &ua, &sk, addr);
+	tipc_nametbl_publish(net, &ua, &sk, addr, &skb, &rc_dests);
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 void tipc_net_finalize_work(struct work_struct *work)
diff --git a/net/tipc/node.c b/net/tipc/node.c
index d7cbfa786c132..182c6dbfa49d2 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -397,44 +397,50 @@ static void tipc_node_write_unlock(struct tipc_node *n)
 	__releases(n->lock)
 {
 	struct tipc_socket_addr sk;
+	struct sk_buff *skb = NULL;
+	struct sk_buff_head xmitq;
 	struct net *net = n->net;
-	u32 flags = n->action_flags;
-	struct list_head *publ_list;
 	struct tipc_uaddr ua;
 	u32 bearer_id, node;
+	u32 rc_dests;
 
-	if (likely(!flags)) {
+	if (likely(!n->action_flags)) {
 		write_unlock_bh(&n->lock);
 		return;
 	}
 
+	__skb_queue_head_init(&xmitq);
 	tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE,
 		   TIPC_LINK_STATE, n->addr, n->addr);
 	sk.ref = n->link_id;
 	sk.node = tipc_own_addr(net);
 	node = n->addr;
 	bearer_id = n->link_id & 0xffff;
-	publ_list = &n->publ_list;
-
-	n->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |
-			     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);
 
-	write_unlock_bh(&n->lock);
+	if (n->action_flags & TIPC_NOTIFY_NODE_DOWN)
+		tipc_publ_notify(net, &n->publ_list, n->capabilities);
 
-	if (flags & TIPC_NOTIFY_NODE_DOWN)
-		tipc_publ_notify(net, publ_list, node, n->capabilities);
+	if (n->action_flags & TIPC_NOTIFY_NODE_UP)
+		tipc_named_node_up(net, node, n->capabilities, &xmitq);
 
-	if (flags & TIPC_NOTIFY_NODE_UP)
-		tipc_named_node_up(net, node, n->capabilities);
-
-	if (flags & TIPC_NOTIFY_LINK_UP) {
+	if (n->action_flags & TIPC_NOTIFY_LINK_UP) {
 		tipc_mon_peer_up(net, node, bearer_id);
-		tipc_nametbl_publish(net, &ua, &sk, sk.ref);
+		tipc_nametbl_publish(net, &ua, &sk, sk.ref, &skb, &rc_dests);
 	}
-	if (flags & TIPC_NOTIFY_LINK_DOWN) {
+	if (n->action_flags & TIPC_NOTIFY_LINK_DOWN) {
 		tipc_mon_peer_down(net, node, bearer_id);
-		tipc_nametbl_withdraw(net, &ua, &sk, sk.ref);
+		tipc_nametbl_withdraw(net, &ua, &sk, sk.ref, &skb, &rc_dests);
 	}
+
+	n->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP |
+			     TIPC_NOTIFY_LINK_DOWN | TIPC_NOTIFY_LINK_UP);
+	write_unlock_bh(&n->lock);
+
+	if (!skb_queue_empty(&xmitq))
+		tipc_node_xmit(net, &xmitq, node, 0);
+
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
 }
 
 static void tipc_node_assign_peer_net(struct tipc_node *n, u32 hash_mixes)
@@ -653,40 +659,14 @@ void tipc_node_stop(struct net *net)
 	spin_unlock_bh(&tn->node_list_lock);
 }
 
-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr)
+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list)
 {
-	struct tipc_node *n;
-
-	if (in_own_node(net, addr))
-		return;
-
-	n = tipc_node_find(net, addr);
-	if (!n) {
-		pr_warn("Node subscribe rejected, unknown node 0x%x\n", addr);
-		return;
-	}
-	tipc_node_write_lock(n);
-	list_add_tail(subscr, &n->publ_list);
-	tipc_node_write_unlock_fast(n);
-	tipc_node_put(n);
+	list_add_tail(subscr, publ_list);
 }
 
-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr)
+void tipc_node_unsubscribe(struct list_head *subscr)
 {
-	struct tipc_node *n;
-
-	if (in_own_node(net, addr))
-		return;
-
-	n = tipc_node_find(net, addr);
-	if (!n) {
-		pr_warn("Node unsubscribe rejected, unknown node 0x%x\n", addr);
-		return;
-	}
-	tipc_node_write_lock(n);
 	list_del_init(subscr);
-	tipc_node_write_unlock_fast(n);
-	tipc_node_put(n);
 }
 
 int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port)
@@ -1917,10 +1897,14 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
 		tipc_node_mcast_rcv(n);
 
 	/* Handle NAME_DISTRIBUTOR messages sent from 1.7 nodes */
-	if (!skb_queue_empty(&n->bc_entry.namedq))
+	if (!skb_queue_empty(&n->bc_entry.namedq)) {
+		tipc_node_write_lock(n);
 		tipc_named_rcv(net, &n->bc_entry.namedq,
+			       &n->publ_list,
 			       &n->bc_entry.named_rcv_nxt,
 			       &n->bc_entry.named_open);
+		tipc_node_write_unlock_fast(n);
+	}
 
 	/* If reassembly or retransmission failure => reset all links to peer */
 	if (rc & TIPC_LINK_DOWN_EVT)
@@ -2198,10 +2182,14 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
 	if (unlikely(rc & TIPC_LINK_DOWN_EVT))
 		tipc_node_link_down(n, bearer_id, false);
 
-	if (unlikely(!skb_queue_empty(&n->bc_entry.namedq)))
+	if (unlikely(!skb_queue_empty(&n->bc_entry.namedq))) {
+		tipc_node_write_lock(n);
 		tipc_named_rcv(net, &n->bc_entry.namedq,
+			       &n->publ_list,
 			       &n->bc_entry.named_rcv_nxt,
 			       &n->bc_entry.named_open);
+		tipc_node_write_unlock_fast(n);
+	}
 
 	if (unlikely(!skb_queue_empty(&n->bc_entry.inputq1)))
 		tipc_node_mcast_rcv(n);
diff --git a/net/tipc/node.h b/net/tipc/node.h
index 154a5bbb0d29d..3599e48457bb9 100644
--- a/net/tipc/node.h
+++ b/net/tipc/node.h
@@ -103,8 +103,8 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, u32 dnode,
 int tipc_node_distr_xmit(struct net *net, struct sk_buff_head *list);
 int tipc_node_xmit_skb(struct net *net, struct sk_buff *skb, u32 dest,
 		       u32 selector);
-void tipc_node_subscribe(struct net *net, struct list_head *subscr, u32 addr);
-void tipc_node_unsubscribe(struct net *net, struct list_head *subscr, u32 addr);
+void tipc_node_subscribe(struct list_head *subscr, struct list_head *publ_list);
+void tipc_node_unsubscribe(struct list_head *subscr);
 void tipc_node_broadcast(struct net *net, struct sk_buff *skb, int rc_dests);
 int tipc_node_add_conn(struct net *net, u32 dnode, u32 port, u32 peer_port);
 void tipc_node_remove_conn(struct net *net, u32 dnode, u32 port);
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index d5d70eb230b56..dda247db0e60d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2906,23 +2906,27 @@ static void tipc_sk_timeout(struct timer_list *t)
 
 static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 {
-	struct sock *sk = &tsk->sk;
-	struct net *net = sock_net(sk);
+	struct net *net = sock_net(&tsk->sk);
 	struct tipc_socket_addr skaddr;
+	struct sk_buff *skb = NULL;
 	struct publication *p;
+	u32 rc_dests;
 	u32 key;
 
-	if (tipc_sk_connected(sk))
+	if (tipc_sk_connected(&tsk->sk))
 		return -EINVAL;
 	key = tsk->portid + tsk->pub_count + 1;
 	if (key == tsk->portid)
 		return -EADDRINUSE;
 	skaddr.ref = tsk->portid;
 	skaddr.node = tipc_own_addr(net);
-	p = tipc_nametbl_publish(net, ua, &skaddr, key);
+	p = tipc_nametbl_publish(net, ua, &skaddr, key, &skb, &rc_dests);
 	if (unlikely(!p))
 		return -EINVAL;
 
+	if (skb)
+		tipc_node_broadcast(net, skb, rc_dests);
+
 	list_add(&p->binding_sock, &tsk->publications);
 	tsk->pub_count++;
 	tsk->published = true;
@@ -2934,13 +2938,19 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 	struct net *net = sock_net(&tsk->sk);
 	struct publication *safe, *p;
 	struct tipc_uaddr _ua;
+	struct sk_buff *skb;
 	int rc = -EINVAL;
+	u32 rc_dests;
 
 	list_for_each_entry_safe(p, safe, &tsk->publications, binding_sock) {
+		skb = NULL;
 		if (!ua) {
 			tipc_uaddr(&_ua, TIPC_SERVICE_RANGE, p->scope,
 				   p->sr.type, p->sr.lower, p->sr.upper);
-			tipc_nametbl_withdraw(net, &_ua, &p->sk, p->key);
+			tipc_nametbl_withdraw(net, &_ua, &p->sk, p->key,
+					      &skb, &rc_dests);
+			if (skb)
+				tipc_node_broadcast(net, skb, rc_dests);
 			continue;
 		}
 		/* Unbind specific publication */
@@ -2952,7 +2962,9 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)
 			continue;
 		if (p->sr.upper != ua->sr.upper)
 			break;
-		tipc_nametbl_withdraw(net, ua, &p->sk, p->key);
+		tipc_nametbl_withdraw(net, ua, &p->sk, p->key, &skb, &rc_dests);
+		if (skb)
+			tipc_node_broadcast(net, skb, rc_dests);
 		rc = 0;
 		break;
 	}

21/3 2026/10/05 04:36 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 9517
							output: 38
							thoughts: 1797
						

Thoughts:
**KMSAN Evaluation for TIPC Patch**

Alright, let's break this down. My goal is to determine if this TIPC kernel patch warrants a dedicated KMSAN fuzzing session. First, I need to be absolutely clear on the KMSAN triggers. We're looking for reads of uninitialized memory—stack, heap, or page allocations—and potential kernel-to-user memory leaks.  KASAN isn't the concern here; we're past the bounds, use-after-free, and lockdep checks.

The rules are pretty straightforward:

*   **NeedsKMSAN=true** if the patch is changing how kernel structures interact with user space (think `copy_to_user`, `put_user`, netlink attributes, ioctl output, socket options, or BPF buffers), especially if structure padding or fields *might* be uninitialized. Also if we have logic that *depends* on possibly uninitialized variables, conditional branching. Or we have complex data structure that we allocate and read fields from later. Also any changes in boundaries that let surrounding code access uninitialized bytes.
*   **NeedsKMSAN=false** if the patch is mainly about bounds checking, null pointer dereferences, locking deadlocks, use-after-free issues, and if the data structures touched by the patch are zeroed or initialized properly. Also, no risk of uninitialized memory usage or information leaks.

Okay, let's dive into this patch. From a high level, it looks like there's some serious refactoring going on, particularly around how the TIPC subsystem handles data transmission and locking. The code is getting a bit re-organized, and function calls are moving around for better performance and locking structure. The primary changes are in `net/tipc/name_distr.c`, `net/tipc/name_table.c`, and `net/tipc/node.c`.

Specifically, in `name_distr.c`, it seems we're shifting around how `sk_buff_head` instances are handled. Instead of local copies, the caller is now passing `xmitq`, and calls to `tipc_node_xmit` are happening outside of locks. Also changes in how `publ_list` is handled. We have similar changes in `name_table.c`: `sk_buff` and `rc_dests` are being output to the caller, and the broadcast happens outside locks in functions like `tipc_nametbl_publish` and `tipc_nametbl_withdraw`.

`node.c` looks like the core of the changes. The way `tipc_node_write_unlock` handles notification flags is heavily modified to move certain operations (like `tipc_publ_notify`, `tipc_named_node_up`, `tipc_nametbl_publish`, and `tipc_nametbl_withdraw`) outside the critical section, but this is an optimization that is implemented through the structure of an `xmitq`, a broadcast, and several calls to `tipc_node_broadcast`. The calls to  `tipc_node_subscribe` and `tipc_node_unsubscribe` are simplified, too.

Now the critical part: Are there any potential uninitialized variables, info leaks, or uninitialized memory reads? It is a complex set of refactors, so I need to make sure I don't miss something. I need to focus on where data is passed *out* to the caller, specifically `skb` and `rc_dests`, when the call to `tipc_nametbl_publish` and `tipc_nametbl_withdraw` are made. The `net/tipc/name_table.c` file warrants closer inspection, so I'll examine the source there more closely. I should also check `tipc_node_write_unlock` and calls to `tipc_node_broadcast`, to ensure that those pointers and destination lists are fully initialized before any access or usage.

So, I will look at the files `net/tipc/name_distr.c`, `net/tipc/name_table.c`, and `net/tipc/node.c`.
I will focus on the `tipc_node_write_unlock`, `tipc_nametbl_publish`, and `tipc_nametbl_withdraw` functions in `net/tipc/node.c` and `net/tipc/name_table.c`. Let's use `read-file` to view the original code and the new patch code.
I need to make sure I don't miss anything.

Based on this first pass, the changes *might* introduce a KMSAN risk. The data is transferred out, and if the caller doesn


22/3 2026/10/05 04:37 tool read-file
0m Args:
{
  "File": "net/tipc/name_table.c",
  "FirstLine": 760,
  "LineCount": 85
}

Results:
{
  "Contents": " 760:\t/* tipc_nametbl_publish - add service binding to name table\n 761:\t */\n 762:\tstruct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\n 763:\t\t\t\t\t\t struct tipc_socket_addr *sk, u32 key,\n 764:\t\t\t\t\t\t struct sk_buff **skb, u32 *rc_dests)\n 765:\t{\n 766:\t\tstruct name_table *nt = tipc_name_table(net);\n 767:\t\tu32 max_user_pub = TIPC_MAX_PUBL - 1;\n 768:\t\tstruct tipc_net *tn = tipc_net(net);\n 769:\t\tstruct publication *p = NULL;\n 770:\t\tbool protocol_type = false;\n 771:\t\n 772:\t\tif (ua-\u003esr.type == TIPC_NODE_STATE || ua-\u003esr.type == TIPC_LINK_STATE ||\n 773:\t\t    ua-\u003esr.type == TIPC_TOP_SRV)\n 774:\t\t\tprotocol_type = true;\n 775:\t\n 776:\t\tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n 777:\t\tif (protocol_type)\n 778:\t\t\tgoto insert;\n 779:\t\n 780:\t\t/* Reserve one entry for node state service type because it has cluster\n 781:\t\t * scope and it is distributed in bulk. So, the maximum number of user's\n 782:\t\t * publications is (TIPC_MAX_PUBL - 1).\n 783:\t\t */\n 784:\t\tif (nt-\u003elocal_publ_count \u003e= max_user_pub) {\n 785:\t\t\tpr_warn(\"Bind failed, max limit %u reached\\n\", max_user_pub);\n 786:\t\t\tgoto exit;\n 787:\t\t}\n 788:\t\n 789:\tinsert:\n 790:\t\tp = tipc_nametbl_insert_publ(net, ua, sk, key);\n 791:\t\tif (p) {\n 792:\t\t\t/* Not count node state, link state and topology server types\n 793:\t\t\t * so that maximum nt-\u003elocal_publ_count does not prevent\n 794:\t\t\t * protocol service types from being inserted into the name\n 795:\t\t\t * table.\n 796:\t\t\t */\n 797:\t\t\tif (!protocol_type)\n 798:\t\t\t\tnt-\u003elocal_publ_count++;\n 799:\t\t\t*skb = tipc_named_publish(net, p);\n 800:\t\t}\n 801:\t\t*rc_dests = nt-\u003erc_dests;\n 802:\texit:\n 803:\t\tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n 804:\t\n 805:\t\treturn p;\n 806:\t\n 807:\t}\n 808:\t\n 809:\t/**\n 810:\t * tipc_nametbl_withdraw - withdraw a service binding\n 811:\t * @net: network namespace\n 812:\t * @ua: service address/range being unbound\n 813:\t * @sk: address of the socket being unbound from\n 814:\t * @key: target publication key\n 815:\t * skb: name distribution message needs to be sent\n 816:\t * rc_dests: the number of replicast destinations\n 817:\t */\n 818:\tvoid tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\n 819:\t\t\t\t   struct tipc_socket_addr *sk, u32 key,\n 820:\t\t\t\t   struct sk_buff **skb, u32 *rc_dests)\n 821:\t{\n 822:\t\tstruct name_table *nt = tipc_name_table(net);\n 823:\t\tstruct tipc_net *tn = tipc_net(net);\n 824:\t\tstruct publication *p;\n 825:\t\n 826:\t\tspin_lock_bh(\u0026tn-\u003enametbl_lock);\n 827:\t\n 828:\t\tp = tipc_nametbl_remove_publ(net, ua, sk, key);\n 829:\t\tif (p) {\n 830:\t\t\tif (p-\u003esr.type != TIPC_NODE_STATE \u0026\u0026\n 831:\t\t\t    p-\u003esr.type != TIPC_LINK_STATE \u0026\u0026\n 832:\t\t\t    p-\u003esr.type != TIPC_TOP_SRV)\n 833:\t\t\t\tnt-\u003elocal_publ_count--;\n 834:\t\t\t*skb = tipc_named_withdraw(net, p);\n 835:\t\t\tlist_del_init(\u0026p-\u003ebinding_sock);\n 836:\t\t\tkfree_rcu(p, rcu);\n 837:\t\t}\n 838:\t\t*rc_dests = nt-\u003erc_dests;\n 839:\t\tspin_unlock_bh(\u0026tn-\u003enametbl_lock);\n 840:\t}\n 841:\t\n 842:\t/**\n 843:\t * tipc_nametbl_subscribe - add a subscription object to the name table\n 844:\t * @sub: subscription to add\n"
}

23/3 2026/10/05 04:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 13775
							output: 37
							thoughts: 1169
						

Thoughts:
**Analyzing Potential Issues in TIPC Publication/Withdrawal**

Okay, here's what's running through my head as I examine this code. I need to understand potential scenarios where `skb` and `rc_dests` might not be assigned in the `tipc_nametbl_publish` and `tipc_nametbl_withdraw` functions.

First, let's focus on `tipc_nametbl_publish`. I see line 784: `if (nt->local_publ_count >= max_user_pub)`. If this condition is true, there's a `goto exit;`.  My concern is what happens to `*skb` and `*rc_dests` in this `goto` path. The code jumps right over the assignment of `*skb`!  So, if the publication limit is reached, `*skb` will *not* be assigned. Further, looking back at line 769, `struct publication *p = NULL;` shows that if there is a problem, *skb* isn't going to get set.

Now, what if `tipc_nametbl_insert_publ` returns NULL? That also means `*skb` will not be assigned because the `*skb = ...` assignment is conditional on `p` not being NULL. We need to be aware that `*skb` might remain uninitialized in these cases.

Next, I need to see where this function is called and how the returned `skb` is used. I'm focusing on two callers: `tipc_net_finalize` and `tipc_node_write_unlock`.

In `tipc_net_finalize`, `skb` is initialized to NULL. If `tipc_nametbl_publish` doesn't assign to `*skb`, it remains NULL, and the `if (skb)` condition will be false. Consequently, `rc_dests` is never read in this case. However, if `skb` is non-null, `p` must be non-null, and `*rc_dests = nt->rc_dests` was executed.

Now, in `tipc_node_write_unlock`, things get interesting, especially because of `tipc_nametbl_withdraw`. I see that `tipc_nametbl_withdraw` *also* doesn't assign to `*skb` if the publication cannot be removed. Line 1969 `if (p)` is important because if p is NULL, then *skb* isn't set, as in `tipc_nametbl_publish`. This also means `*skb` remains NULL.  But, what is `skb` initialized to? Oh, in `tipc_node_write_unlock`, `skb` is initialized to NULL: `struct sk_buff *skb = NULL;`.

I need to confirm if this pattern of potentially uninitialized `skb` is safe. I need to consider `tipc_sk_withdraw` in `net/tipc/socket.c` to see if there is similar logic. I am going to examine the code around lines 2938-2970 in `net/tipc/socket.c` now to confirm this.



24/3 2026/10/05 04:37 tool read-file
0m Args:
{
  "File": "net/tipc/socket.c",
  "FirstLine": 2935,
  "LineCount": 40
}

Results:
{
  "Contents": "2935:\t\n2936:\tstatic int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n2937:\t{\n2938:\t\tstruct net *net = sock_net(\u0026tsk-\u003esk);\n2939:\t\tstruct publication *safe, *p;\n2940:\t\tstruct tipc_uaddr _ua;\n2941:\t\tstruct sk_buff *skb;\n2942:\t\tint rc = -EINVAL;\n2943:\t\tu32 rc_dests;\n2944:\t\n2945:\t\tlist_for_each_entry_safe(p, safe, \u0026tsk-\u003epublications, binding_sock) {\n2946:\t\t\tskb = NULL;\n2947:\t\t\tif (!ua) {\n2948:\t\t\t\ttipc_uaddr(\u0026_ua, TIPC_SERVICE_RANGE, p-\u003escope,\n2949:\t\t\t\t\t   p-\u003esr.type, p-\u003esr.lower, p-\u003esr.upper);\n2950:\t\t\t\ttipc_nametbl_withdraw(net, \u0026_ua, \u0026p-\u003esk, p-\u003ekey,\n2951:\t\t\t\t\t\t      \u0026skb, \u0026rc_dests);\n2952:\t\t\t\tif (skb)\n2953:\t\t\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n2954:\t\t\t\tcontinue;\n2955:\t\t\t}\n2956:\t\t\t/* Unbind specific publication */\n2957:\t\t\tif (p-\u003escope != ua-\u003escope)\n2958:\t\t\t\tcontinue;\n2959:\t\t\tif (p-\u003esr.type != ua-\u003esr.type)\n2960:\t\t\t\tcontinue;\n2961:\t\t\tif (p-\u003esr.lower != ua-\u003esr.lower)\n2962:\t\t\t\tcontinue;\n2963:\t\t\tif (p-\u003esr.upper != ua-\u003esr.upper)\n2964:\t\t\t\tbreak;\n2965:\t\t\ttipc_nametbl_withdraw(net, ua, \u0026p-\u003esk, p-\u003ekey, \u0026skb, \u0026rc_dests);\n2966:\t\t\tif (skb)\n2967:\t\t\t\ttipc_node_broadcast(net, skb, rc_dests);\n2968:\t\t\trc = 0;\n2969:\t\t\tbreak;\n2970:\t\t}\n2971:\t\tif (list_empty(\u0026tsk-\u003epublications)) {\n2972:\t\t\ttsk-\u003epublished = 0;\n2973:\t\t\trc = 0;\n2974:\t\t}\n"
}

25/3 2026/10/05 04:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16360
							output: 31
							thoughts: 912
						

Thoughts:
**Analyzing Potential SKB Leak in TIPC Publication/Withdrawal**

Okay, hold on a second. I need to dig into this `list_for_each_entry_safe` loop in lines 2941-2946. Something's nagging at me about potential memory leaks related to the `skb` (socket buffer) handling. Specifically, I'm focusing on the interaction between the outer loop's initialization and the inner function calls.

I see that `skb` is initialized to `NULL` at the beginning of each loop iteration. This is standard, good practice. However, inside the loop, we call `tipc_nametbl_withdraw`. Let's step through the logic.

First, if certain scope, type, and range criteria are *not* met, we `continue;` skipping the subsequent checks within the current loop iteration. *This is standard logic*.

If the criteria are met, we call `tipc_nametbl_withdraw`. Inside `tipc_nametbl_withdraw`, a call to `tipc_nametbl_remove_publ` attempts to remove a publication. If the publication is found, the returned pointer is assigned to `p`, and `*skb` *is* assigned the result of `tipc_named_withdraw(net, p)`. *This is also normal, and standard logic*. Then `*rc_dests` is assigned from a nametable struct `nt->rc_dests`.

Now, here's where my alarm bells start ringing. What if `tipc_nametbl_remove_publ` *doesn't* find the publication? If `p` is `NULL`, then `*skb` isn't assigned anything. But then `skb` was initialized to `NULL` at the start of the outer loop iteration, and the conditional `if (skb)` will be false, and nothing bad will happen.

However, if `tipc_nametbl_remove_publ` *does* find the publication and `tipc_named_withdraw` returns NULL, again, `*skb` will be NULL, and everything will be okay.

Okay, so it *seems* we're covered in both of these scenarios. The `skb` is properly handled whether or not the publication exists in the table. So `if (skb)` should catch all the possible cases where we're supposed to free an `skb`.

To be *absolutely* sure, I need to check all callers of `tipc_nametbl_publish` and `tipc_nametbl_withdraw` to ensure there aren't any other code paths where `skb` might not be initialized to `NULL` *before* the call to `tipc_nametbl_withdraw` and it could remain unassigned after the call, leading to potential issues down the line. I'll need to do a thorough code search for those functions.



26/3 2026/10/05 04:37 tool grepper
0m Args:
{
  "Expression": "tipc_nametbl_publish|tipc_nametbl_withdraw"
}

Results:
{
  "Output": "net/tipc/name_table.c=732=void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,\n--\nnet/tipc/name_table.c-759-\nnet/tipc/name_table.c:760:/* tipc_nametbl_publish - add service binding to name table\nnet/tipc/name_table.c-761- */\nnet/tipc/name_table.c:762:struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\nnet/tipc/name_table.c-763-\t\t\t\t\t struct tipc_socket_addr *sk, u32 key,\n--\nnet/tipc/name_table.c-809-/**\nnet/tipc/name_table.c:810: * tipc_nametbl_withdraw - withdraw a service binding\nnet/tipc/name_table.c-811- * @net: network namespace\n--\nnet/tipc/name_table.c-817- */\nnet/tipc/name_table.c:818:void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\nnet/tipc/name_table.c-819-\t\t\t   struct tipc_socket_addr *sk, u32 key,\n--\nnet/tipc/name_table.h=126=void tipc_nametbl_build_group(struct net *net, struct tipc_group *grp,\nnet/tipc/name_table.h-127-\t\t\t      struct tipc_uaddr *ua);\nnet/tipc/name_table.h:128:struct publication *tipc_nametbl_publish(struct net *net, struct tipc_uaddr *ua,\nnet/tipc/name_table.h-129-\t\t\t\t\t struct tipc_socket_addr *sk, u32 key,\nnet/tipc/name_table.h-130-\t\t\t\t\t struct sk_buff **skb, u32 *rc_dests);\nnet/tipc/name_table.h:131:void tipc_nametbl_withdraw(struct net *net, struct tipc_uaddr *ua,\nnet/tipc/name_table.h-132-\t\t\t   struct tipc_socket_addr *sk, u32 key,\n--\nnet/tipc/net.c=126=static void tipc_net_finalize(struct net *net, u32 addr)\n--\nnet/tipc/net.c-142-\ttipc_mon_reinit_self(net);\nnet/tipc/net.c:143:\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, addr, \u0026skb, \u0026rc_dests);\nnet/tipc/net.c-144-\tif (skb)\n--\nnet/tipc/node.c=396=static void tipc_node_write_unlock(struct tipc_node *n)\n--\nnet/tipc/node.c-427-\t\ttipc_mon_peer_up(net, node, bearer_id);\nnet/tipc/node.c:428:\t\ttipc_nametbl_publish(net, \u0026ua, \u0026sk, sk.ref, \u0026skb, \u0026rc_dests);\nnet/tipc/node.c-429-\t}\n--\nnet/tipc/node.c-431-\t\ttipc_mon_peer_down(net, node, bearer_id);\nnet/tipc/node.c:432:\t\ttipc_nametbl_withdraw(net, \u0026ua, \u0026sk, sk.ref, \u0026skb, \u0026rc_dests);\nnet/tipc/node.c-433-\t}\n--\nnet/tipc/socket.c=2907=static int tipc_sk_publish(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n--\nnet/tipc/socket.c-2922-\tskaddr.node = tipc_own_addr(net);\nnet/tipc/socket.c:2923:\tp = tipc_nametbl_publish(net, ua, \u0026skaddr, key, \u0026skb, \u0026rc_dests);\nnet/tipc/socket.c-2924-\tif (unlikely(!p))\n--\nnet/tipc/socket.c=2936=static int tipc_sk_withdraw(struct tipc_sock *tsk, struct tipc_uaddr *ua)\n--\nnet/tipc/socket.c-2949-\t\t\t\t   p-\u003esr.type, p-\u003esr.lower, p-\u003esr.upper);\nnet/tipc/socket.c:2950:\t\t\ttipc_nametbl_withdraw(net, \u0026_ua, \u0026p-\u003esk, p-\u003ekey,\nnet/tipc/socket.c-2951-\t\t\t\t\t      \u0026skb, \u0026rc_dests);\n--\nnet/tipc/socket.c-2964-\t\t\tbreak;\nnet/tipc/socket.c:2965:\t\ttipc_nametbl_withdraw(net, ua, \u0026p-\u003esk, p-\u003ekey, \u0026skb, \u0026rc_dests);\nnet/tipc/socket.c-2966-\t\tif (skb)\n"
}

27/3 2026/10/05 04:37 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 19282
							output: 335
							thoughts: 6908
						

Thoughts:
**Analysis of TIPC Locking and Memory Initialization**

Okay, let's break this down. We're looking at a patch that fundamentally alters the locking strategy within the TIPC (Tunneling IPC) system, specifically around how publications, node state changes, and broadcasting are handled. The core issue is the potential for deadlocks and race conditions due to the interactions between node locks and the name table lock. This is a critical point, and the patch aims to resolve this issue.

Initially, I see `tipc_sk_publish`, which publishes socket addresses. Within that, it calls `tipc_nametbl_publish`, passing a `struct sk_buff **skb` and `u32 *rc_dests`. My initial thought is to make sure those parameters are correctly initialized and handled. Upon checking the source, `skb` is initialized to NULL.

Now, looking deeper, inside `tipc_nametbl_publish`, there's a limit to the publications (`max_user_pub`). If the limit is reached, the function *doesn't* assign to `*skb`, or `*rc_dests` and returns NULL to the caller which in turn returns `-EINVAL`. This is okay, the callers (`tipc_sk_publish`, `tipc_node_write_unlock`, and `tipc_net_finalize`) are doing the right thing by initializing `skb` to NULL.

Then, there's `tipc_node_write_unlock`. This function deals with node state transitions (link up/down, node up/down). It also calls `tipc_nametbl_publish` or `tipc_nametbl_withdraw` *conditionally* depending on flags, passing `&skb` and `&rc_dests` which are also initialized to NULL, to ensure they remain safe if the functions do not assign to them. The important part is making sure that if `publish` runs, and later `withdraw` runs, the previous `skb` doesn't leak. Then I check both `tipc_nametbl_publish` and `tipc_nametbl_withdraw`. Both do the correct thing with uninitialized `skb` to avoid leaks, and the caller is already initializing `skb` to NULL.

The `tipc_nametbl_withdraw` function also takes and modifies `skb`. If the publication isn't found, then `*skb` isn't assigned, and the caller checks `if (skb)`, so no problem.

Furthermore, `tipc_node_write_unlock` also calls `tipc_named_node_up` and `tipc_publ_notify`. These calls handle node broadcasts, and publication purges, respectively. I checked that this `xmitq` and `publ_list` is safe here.

The key change, in this patch, is about locking:
1)  We're protecting `publ_list` from concurrent access.
2)  We're preventing deadlocks with the nametable.

The patch's modifications ensure that critical sections are protected under their respective locks. The `skb` and `rc_dests` parameters are now passed as output parameters for `tipc_nametbl_publish` and `tipc_nametbl_withdraw`, which broadcast outside the nametable lock which avoids deadlocks.

I have thoroughly checked the potential for use-after-free conditions, uninitialized memory reads, buffer overflows, and locking issues. There's no uninitialized memory. The risks are locking related: deadlocks, use-after-free, list corruption, and that is handled by KASAN and LOCKDEP.

Therefore, since this patch's primary concern is locking and does not introduce uninitialized memory issues, there is NO need for KMSAN. The problems this patch addresses are those detectable by KASAN, LOCKDEP, and other kernel hardening tools. The memory is always properly initialized.

```
set-results NeedsKMSAN=false
```



28/3 2026/10/05 04:37 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch refactors TIPC locking and publication management to avoid deadlocks and race conditions between node locks (`n-\u003elock`) and the name table lock (`tn-\u003enametbl_lock`). Specifically:\n- `tipc_named_node_up` and `tipc_nametbl_publish`/`tipc_nametbl_withdraw` no longer broadcast or transmit packets directly under locks; instead, they defer transmission to callers by passing back an skb or appending to an skb queue (`xmitq`).\n- `tipc_node_subscribe` and `tipc_node_unsubscribe` are simplified to operate directly on the publication list under callers' existing locks.\n- In `tipc_node_write_unlock`, node notification handlers are called with appropriate locking, and outgoing skbs/broadcasts are transmitted after unlocking `n-\u003elock`.\n\nAll newly introduced local variables (e.g., `skb = NULL`, queue head initialized via `__skb_queue_head_init`, `rc_dests` populated when publications are generated) are initialized before use. There are no allocations of uninitialized memory, no structures copied to user space, and no branching on uninitialized data. Any potential bugs introduced by these changes are concurrency, locking (deadlock/lock inversion), or object lifecycle/use-after-free issues, all of which are covered by LOCKDEP and KASAN. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch refactors TIPC locking and publication management to avoid deadlocks and race conditions between node locks (`n-\u003elock`) and the name table lock (`tn-\u003enametbl_lock`). Specifically:\n- `tipc_named_node_up` and `tipc_nametbl_publish`/`tipc_nametbl_withdraw` no longer broadcast or transmit packets directly under locks; instead, they defer transmission to callers by passing back an skb or appending to an skb queue (`xmitq`).\n- `tipc_node_subscribe` and `tipc_node_unsubscribe` are simplified to operate directly on the publication list under callers' existing locks.\n- In `tipc_node_write_unlock`, node notification handlers are called with appropriate locking, and outgoing skbs/broadcasts are transmitted after unlocking `n-\u003elock`.\n\nAll newly introduced local variables (e.g., `skb = NULL`, queue head initialized via `__skb_queue_head_init`, `rc_dests` populated when publications are generated) are initialized before use. There are no allocations of uninitialized memory, no structures copied to user space, and no branching on uninitialized data. Any potential bugs introduced by these changes are concurrency, locking (deadlock/lock inversion), or object lifecycle/use-after-free issues, all of which are covered by LOCKDEP and KASAN. Therefore, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)