From: sashiko-bot@kernel.org
To: "Jacob Moroni" <jmoroni@google.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next 1/2] RDMA/irdma: Fix potential UAF during SRQ limit AE handling
Date: Mon, 09 Nov 2026 20:35:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-205588@kernel.org> (raw)
In-Reply-To: <20261109202525.2937295-1-jmoroni@google.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] RDMA/irdma: SRQ ID leak in irdma_create_srq() [1]
--
commit df1284da749f5b8315f44692f641894f41a2494c
Author: Jacob Moroni <jmoroni@google.com>
RDMA/irdma: Fix potential UAF during SRQ limit AE handling
This commit replaces the raw SRQ pointer in the AE cookie with the SRQ ID
and uses an XArray lookup with reference counting to prevent
use-after-free during SRQ limit AE processing.
> diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
> index 72de5738ae470..e07b6b40dd992 100644
> --- a/drivers/infiniband/hw/irdma/verbs.c
> +++ b/drivers/infiniband/hw/irdma/verbs.c
[ ... ]
> @@ -2575,6 +2579,7 @@ static int irdma_create_srq(struct ib_srq *ibsrq,
> return -EINVAL;
>
> refcount_set(&iwsrq->refcnt, 1);
> + init_completion(&iwsrq->free_srq);
> spin_lock_init(&iwsrq->lock);
> err_code = irdma_alloc_rsrc(rf, rf->allocated_srqs, rf->max_srq,
> &iwsrq->srq_num, &rf->next_srq);
[Severity: High]
This problem wasn't introduced by this patch, but does irdma_create_srq()
leak the SRQ ID in iwsrq->srq_num [1] if irdma_get_srqdepth() fails?
drivers/infiniband/hw/irdma/verbs.c:irdma_create_srq() {
...
err_code = irdma_alloc_rsrc(rf, rf->allocated_srqs, rf->max_srq,
&iwsrq->srq_num, &rf->next_srq);
if (err_code)
return err_code;
...
err_code = irdma_get_srqdepth(ukinfo->uk_attrs, attr->max_wr,
shift, &depth);
if (err_code)
return err_code;
...
}
When irdma_get_srqdepth() rejects invalid attr->max_wr values, returning
directly skips the free_rsrc cleanup path and leaves the bit set in
rf->allocated_srqs, allowing an unprivileged user to exhaust the device's
SRQ ID pool via uverbs.
[1] https://sashiko.dev/#/bug/linux-ec859386-8123-4946-9c12-458c13e3f421
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109202525.2937295-1-jmoroni@google.com?part=1
next prev parent reply other threads:[~2026-11-09 20:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 20:25 [PATCH rdma-next 1/2] RDMA/irdma: Fix potential UAF during SRQ limit AE handling Jacob Moroni
2026-11-09 20:25 ` [PATCH rdma-next 2/2] RDMA/irdma: Drop unused SRQ table from resource memory Jacob Moroni
2026-11-09 20:30 ` sashiko-bot
2026-11-09 20:35 ` sashiko-bot [this message]
2026-11-09 20:37 ` [PATCH rdma-next 1/2] RDMA/irdma: Fix potential UAF during SRQ limit AE handling Jacob Moroni
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-205588@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=jmoroni@google.com \
--cc=linux-rdma@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox