From: sashiko-bot@kernel.org
To: "Bin Luo (University of Electronic Science and Technology of
China)" <luob87709@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] IB/ipoib: re-lookup mcast and pin ah across lock drop in ipoib_mcast_send()
Date: Thu, 26 Nov 2026 06:59:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-234921@kernel.org> (raw)
In-Reply-To: <20261126065125.1082-1-luob87709@gmail.com>
> In ipoib_mcast_send(), priv->lock is dropped around ipoib_neigh_get()
> and reacquired without re-validating mcast. During that window,
> ipoib_mcast_dev_flush() can unlink mcast from priv->multicast_list and
> priv->multicast_tree, and ipoib_mcast_free() can run
> ipoib_del_neighs_by_gid() and ipoib_put_ah(mcast->ah) before blocking
> on netif_tx_lock_bh().
>
> When ipoib_mcast_send() reacquires priv->lock, it can attach a newly
> allocated neigh onto the dying mcast->neigh_list (leaving a dangling
> list pointer once ipoib_mcast_free() calls kfree(mcast)) and access
> mcast->ah after its reference was dropped. Furthermore, mcast->ah is
> dereferenced after priv->lock is released without holding a dedicated
> reference when neigh allocation fails.
>
> Re-lookup mcast with __ipoib_mcast_find() after reacquiring priv->lock,
> drop the skb if mcast or mcast->ah is gone, and take a reference on ah
> under priv->lock across rn->send().
>
> Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup in xmit path")
> Signed-off-by: Bin Luo (University of Electronic Science and Technology of China) <luob87709@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126065125.1082-1-luob87709@gmail.com?part=1
next prev parent reply other threads:[~2026-11-26 6:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 6:51 [PATCH] IB/ipoib: re-lookup mcast and pin ah across lock drop in ipoib_mcast_send() Bin Luo (University of Electronic Science and Technology of China)
2026-11-26 6:59 ` sashiko-bot [this message]
2026-11-26 19:00 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-234921@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=luob87709@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.