tipc: avoid use-after-free in poll trace queue dumps
authorZihan Xi <zihanx@nebusec.ai>
Thu, 23 Jul 2026 16:38:41 +0000 (00:38 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 27 Jul 2026 22:18:59 +0000 (15:18 -0700)
commitb4f1719dfea023220e0e6bd892b087d76b2a6a49
treea1d11bfc08aa59a4b1ed619bb9cd068b5e91a671
parent9c88929cc18cdc252aa8a57e9fa8cb441dc47642
tipc: avoid use-after-free in poll trace queue dumps

TIPC socket tracepoints dump queue state through tipc_sk_dump(). Most
queue-dump callsites already serialize that walk under the socket lock or
sk->sk_lock.slock, but tipc_poll() calls trace_tipc_sk_poll(...,
TIPC_DUMP_ALL, ...) without holding either lock.

That lets the poll trace path reach tipc_list_dump() and backlog head/tail
dumping while another context dequeues and frees an skb, leaving the trace
helper dereferencing a stale queue entry.

Stop the unlocked poll trace site from requesting queue dumps. Other queue
dump trace callsites keep their existing output under the locking they
already provide, while poll still emits the event itself without walking
live queue members from an unlocked context.

Fixes: b4b9771bcbbd ("tipc: enable tracepoints in tipc")
Cc: stable@vger.kernel.org
Reported-by: Vega <vega@nebusec.ai>
Signed-off-by: Zihan Xi <zihanx@nebusec.ai>
Signed-off-by: Ren Wei <enjou1224z@gmail.com>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/f8119abd5e5ecc400597de667ae9d39656de56d0.1784794294.git.zihanx@nebusec.ai
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tipc/socket.c