diff options
| author | Li RongQing <lirongqing@baidu.com> | 2026-09-17 13:20:12 +0800 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2026-09-23 06:38:36 -0400 |
| commit | d1fa82ef992bc18850d27bc0bdc7a5cd0821d7b3 (patch) | |
| tree | 1fd941add398a7158daf61a2585313c767ed5a14 /tools/lib/python/kdoc | |
| parent | ef15197f81ffedf29560edf2221199d92fd83dc2 (diff) | |
RDMA/multicast: Fix rb-tree corruption on MGID reassignment in join_handler
When the SA assigns a wildcard (mgid0) join a concrete MGID that already
has a group in the port table, join_handler() erases the group from the
tree and calls mcast_insert() with allow_duplicates=false. mcast_insert()
then finds the existing group and returns it without re-inserting, but
join_handler() discards the return value, leaving the group erased yet
still alive.
When the orphaned group's refcount later drops to zero, release_group()
calls rb_erase() on the node that is no longer in the tree, corrupting
the rb-tree (a stale parent pointer causes a valid subtree link to be
overwritten with NULL).
Clear the node with RB_CLEAR_NODE() after the erase in join_handler() so
release_group() can detect via RB_EMPTY_NODE() that it is already out of
the tree and skip the second erase. A successful re-insert by
mcast_insert() restores the in-tree state via rb_link_node().
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Link: https://patch.msgid.link/20260917052012.2181-1-lirongqing@baidu.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
