From: Jason Gunthorpe <jgg@ziepe.ca>
To: Zhu Yanjun <yanjun.zhu@linux.dev>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
syzbot+72eddfbadda3e3928e72@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/1] RDMA/cma: Fix WARNING in res_to_rt
Date: Mon, 10 Aug 2026 15:37:12 -0300 [thread overview]
Message-ID: <20260810183712.GC507588@ziepe.ca> (raw)
In-Reply-To: <20260810015357.23724-1-yanjun.zhu@linux.dev>
On Mon, Aug 10, 2026 at 03:53:57AM +0200, Zhu Yanjun wrote:
> @@ -3531,7 +3531,8 @@ static void addr_handler(int status, struct sockaddr *src_addr,
> if (status)
> pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to acquire device. status %d\n",
> status);
> - rdma_restrack_add(&id_priv->res);
> + if (id_priv->id.device)
> + rdma_restrack_add(&id_priv->res);
> } else if (status) {
> pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to resolve IP. status %d\n", status);
> }
The full text is:
if (!status && !id_priv->cma_dev) {
status = cma_acquire_dev_by_src_ip(id_priv);
if (status)
pr_debug_ratelimited("RDMA CM: ADDR_ERROR: failed to acquire device. status %d\n",
status);
rdma_restrack_add(&id_priv->res);
What it is trying to do is fill in cma_dev/id.device (they are
linked).
'if (status)' means the resolution failed and the cm_id is not
populated, so it should just be if/else instead of trying to check
id.device
But this does seem to be the bug syzkaller is pointing at, but the
commit message seems really strange.
If status is !0 then we know id.device is NULL and we cannot add this
to restrack. Otherwise it must be !NULL and it must be safe to add it
or we have a locking problem.
Jason
prev parent reply other threads:[~2026-08-10 18:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 1:53 [PATCH 1/1] RDMA/cma: Fix WARNING in res_to_rt Zhu Yanjun
2026-08-10 18:37 ` 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=20260810183712.GC507588@ziepe.ca \
--to=jgg@ziepe.ca \
--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