linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>, linux-rdma@vger.kernel.org
Cc: Avihai Horon <avihaih@nvidia.com>, Eli Cohen <eli@mellanox.co.il>,
	Leon Romanovsky <leonro@nvidia.com>,
	Amit Matityahu <mitm@nvidia.com>,
	patches@lists.linux.dev, Roland Dreier <rolandd@cisco.com>,
	stable@vger.kernel.org,
	syzbot+b0da83a6c0e2e2bddbd4@syzkaller.appspotmail.com
Subject: Re: [PATCH] RDMA/cm: Fix leaking the multicast GID table reference
Date: Tue, 16 Dec 2025 21:44:34 -0400	[thread overview]
Message-ID: <20251217014434.GB148079@nvidia.com> (raw)
In-Reply-To: <0-v1-4285d070a6b2+20a-rdma_mc_gid_leak_syz_jgg@nvidia.com>

On Fri, Nov 28, 2025 at 08:53:21PM -0400, Jason Gunthorpe wrote:
> If the CM ID is destroyed while the CM event for multicast creating is
> still queued the cancel_work_sync() will prevent the work from running
> which also prevents destroying the ah_attr. This leaks a refcount and
> triggers a WARN:
> 
>    GID entry ref leak for dev syz1 index 2 ref=573
>    WARNING: CPU: 1 PID: 655 at drivers/infiniband/core/cache.c:809 release_gid_table drivers/infiniband/core/cache.c:806 [inline]
>    WARNING: CPU: 1 PID: 655 at drivers/infiniband/core/cache.c:809 gid_table_release_one+0x284/0x3cc drivers/infiniband/core/cache.c:886
> 
> Destroy the ah_attr after canceling the work, it is safe to call this
> twice.
> 
> Cc: stable@vger.kernel.org
> Fixes: fe454dc31e84 ("RDMA/ucma: Fix use-after-free bug in ucma_create_uevent")
> Reported-by: syzbot+b0da83a6c0e2e2bddbd4@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/68232e7b.050a0220.f2294.09f6.GAE@google.com
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/infiniband/core/cma.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied to for-rc with the missing hunk

Jason

      parent reply	other threads:[~2025-12-17  1:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-29  0:53 [PATCH] RDMA/cm: Fix leaking the multicast GID table reference Jason Gunthorpe
2025-11-30  0:49 ` Jason Gunthorpe
2025-12-17  1:44 ` 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=20251217014434.GB148079@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=avihaih@nvidia.com \
    --cc=eli@mellanox.co.il \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mitm@nvidia.com \
    --cc=patches@lists.linux.dev \
    --cc=rolandd@cisco.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+b0da83a6c0e2e2bddbd4@syzkaller.appspotmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).