From: sashiko-bot@kernel.org
To: "Yuansheng Yang" <0xbeac@gmail.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/irdma: clear push_wqe_mmap_entry on error in irdma_setup_push_mmap_entries()
Date: Sat, 05 Dec 2026 15:09:08 +0000 [thread overview]
Message-ID: <sashiko-outbox-251677@kernel.org> (raw)
In-Reply-To: <20261205145247.1712139-1-0xbeac@gmail.com>
> In irdma_setup_push_mmap_entries(), iwqp->push_wqe_mmap_entry is stored
> upon the first irdma_user_mmap_entry_insert(). If the second
> irdma_user_mmap_entry_insert() for iwqp->push_db_mmap_entry fails,
> irdma_setup_push_mmap_entries() calls
> rdma_user_mmap_entry_remove(iwqp->push_wqe_mmap_entry) -- dropping the
> sole kref and freeing the entry -- and returns -ENOMEM without resetting
> iwqp->push_wqe_mmap_entry to NULL.
>
> Crucially, both irdma_modify_qp_roce() and irdma_modify_qp() ignore the
> error returned by irdma_setup_push_mmap_entries(). Consequently, either
> an immediate ib_respond_udata() failure or a later _irdma_destroy_qp()
> after an otherwise successful modify_qp calls
> irdma_remove_push_mmap_entries(iwqp) and passes the freed entry to
> rdma_user_mmap_entry_remove() a second time, triggering a use-after-free:
>
> BUG: KASAN: slab-use-after-free in rdma_user_mmap_entry_remove
> Call Trace:
> rdma_user_mmap_entry_remove
> _irdma_destroy_qp
> irdma_destroy_qp
>
> Clear iwqp->push_wqe_mmap_entry to NULL after removing it in
> irdma_setup_push_mmap_entries() so subsequent cleanup via
> irdma_remove_push_mmap_entries() does not touch the freed entry.
>
> Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuansheng Yang <0xbeac@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205145247.1712139-1-0xbeac@gmail.com?part=1
prev parent reply other threads:[~2026-12-05 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 14:52 [PATCH] RDMA/irdma: clear push_wqe_mmap_entry on error in irdma_setup_push_mmap_entries() Yuansheng Yang
2026-12-05 15:09 ` sashiko-bot [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=sashiko-outbox-251677@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=0xbeac@gmail.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