Netdev List
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] tipc: fix NULL deref in tipc_named_node_up() on empty publication list
@ 2026-07-14 17:41 Weiming Shi
  2026-07-14 17:41 ` [PATCH net v3 1/2] tipc: guard against empty list in tipc_node_xmit() Weiming Shi
  2026-07-14 17:41 ` [PATCH net v3 2/2] tipc: fix NULL deref in tipc_named_node_up() on empty publication list Weiming Shi
  0 siblings, 2 replies; 3+ messages in thread
From: Weiming Shi @ 2026-07-14 17:41 UTC (permalink / raw)
  To: Jon Maloy, netdev, tipc-discussion
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Hoang Huu Le, Xiang Mei, Tung Quang Nguyen,
	linux-kernel, Weiming Shi

named_distribute() stamps the last_bulk flag on the tail skb of the
publication list. When the list is empty no skb is enqueued and the tail
access dereferences NULL. tipc_named_node_up() hits this on an empty
cluster_scope, which happens with a node-id configuration where
cluster_scope is populated only later by tipc_net_finalize(). It is
reachable by an unprivileged user over a UDP bearer in a user+net
namespace.

Patch 1 guards tipc_node_xmit() against an empty list, so the allocation-
failure path in named_distribute() cannot pass an empty list down to
tipc_lxc_xmit(), which has the same tail-of-empty-list deref.

Patch 2 emits an item-less bulk when the publication list is empty, so the
peer still receives the last_bulk flag and does not stall this node's later
name updates.

Changes in v3:
 - Split into two patches; add patch 1 to guard tipc_node_xmit() against
   the tipc_lxc_xmit() deref reachable via the allocation-failure path.
 - Break out of the build loop on allocation failure instead of returning,
   so the last_bulk flag is still applied to the last queued skb.

Changes in v2:
 - Instead of returning early on an empty cluster_scope (which would stall
   the peer, since it waits for a bulk with the last_bulk flag before
   accepting later name updates), emit an item-less bulk so the peer opens
   normally.

Thanks to Tung Quang Nguyen for the review of v1.

Weiming Shi (2):
  tipc: guard against empty list in tipc_node_xmit()
  tipc: fix NULL deref in tipc_named_node_up() on empty publication list

 net/tipc/name_distr.c | 16 +++++++++++++++-
 net/tipc/node.c       |  3 +++
 2 files changed, 18 insertions(+), 1 deletion(-)


base-commit: 4595d2c77ea4bfe4ae0efa38770a59ee5d2f06d3
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-14 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 17:41 [PATCH net v3 0/2] tipc: fix NULL deref in tipc_named_node_up() on empty publication list Weiming Shi
2026-07-14 17:41 ` [PATCH net v3 1/2] tipc: guard against empty list in tipc_node_xmit() Weiming Shi
2026-07-14 17:41 ` [PATCH net v3 2/2] tipc: fix NULL deref in tipc_named_node_up() on empty publication list Weiming Shi

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