Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
	syzbot+72eddfbadda3e3928e72@syzkaller.appspotmail.com
Subject: Re: [PATCH v2 1/1] RDMA/cma: Fix WARNING in res_to_rt
Date: Tue, 11 Aug 2026 17:15:35 -0300	[thread overview]
Message-ID: <20260811201535.GA667435@nvidia.com> (raw)
In-Reply-To: <20260810220123.191696-1-yanjun.zhu@linux.dev>

On Tue, Aug 11, 2026 at 12:01:23AM +0200, Zhu Yanjun wrote:
> id_priv->cma_dev and bind the associated ib_device to id_priv->id.device.
> If cma_acquire_dev_by_src_ip() returns an error (non-zero status), the ID
> remains unassociated with any RDMA device.
> 
> Previously, rdma_restrack_add(&id_priv->res) was invoked unconditionally
> even when cma_acquire_dev_by_src_ip() failed, passing a resource with a
> NULL dev pointer and triggering the WARN_ON assertion in res_to_rt().
> 
> Fix this by only adding the resource to restrack when acquiring the device
> succeeds.
> 
> Reported-by: syzbot+72eddfbadda3e3928e72@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=72eddfbadda3e3928e72
> Tested-by: syzbot+72eddfbadda3e3928e72@syzkaller.appspotmail.com
> Fixes: cb5cd0ea4eb3 ("RDMA/core: Add CM to restrack after successful attachment to a device")
> 
> Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
> ---
> V1 -> V2: Follow Jason's advice to use if/else to handle this problem.
> ---
>  drivers/infiniband/core/cma.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied to for-next, thanks

Jason

      parent reply	other threads:[~2026-08-11 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260810220123.191696-1-yanjun.zhu@linux.dev>
2026-08-10 23:59 ` [PATCH v2 1/1] RDMA/cma: Fix WARNING in res_to_rt Zhu Yanjun
2026-08-11 20:15 ` Jason Gunthorpe [this message]

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=20260811201535.GA667435@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=syzbot+72eddfbadda3e3928e72@syzkaller.appspotmail.com \
    --cc=yanjun.zhu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox