From: sashiko-bot@kernel.org
To: "Selvin Xavier" <selvin.xavier@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-rc v2 8/8] RDMA/bnxt_re: Check is_in_used before trusting RCFW completion
Date: Wed, 09 Sep 2026 09:03:11 +0000 [thread overview]
Message-ID: <20260909090312.3F0F01F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909135244.122747-8-selvin.xavier@broadcom.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Duplicate completions for retired internal commands bypass the is_in_used gate, causing timeout_send atomic underflow.
--
commit a5d91fba60b82a58962973687dc528a6bc7de745
Author: Selvin Xavier <selvin.xavier@broadcom.com>
RDMA/bnxt_re: Check is_in_used before trusting RCFW completion
This commit gates crsqe->resp memory copies and timed-out AH destruction on
is_in_used to prevent operating on stale responses. It also disarms waiters
and clears the response pointer when bailing out early on a detached device.
> diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> index 9ee0d500436cb..0339e55bea886 100644
> --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
[ ... ]
> @@ -682,7 +685,7 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
> if (crsqe->is_internal_cmd && !qp_event->status)
> atomic_dec(&rcfw->timeout_send);
[Severity: High]
This isn't a bug introduced by this patch, but does this atomic_dec() in
bnxt_qplib_process_qp_event() need the same is_in_used check that was added
below?
If a late or duplicate firmware completion arrives for an already-retired
internal command, it will bypass the is_in_used gate here. Can this execute an
erroneous atomic_dec() on a stale response and cause the timeout_send counter
to underflow?
> - if (crsqe->is_waiter_alive) {
> + if (crsqe->is_waiter_alive && crsqe->is_in_used) {
> if (crsqe->resp) {
> memcpy(crsqe->resp, qp_event, sizeof(*qp_event));
> /* Insert write memory barrier to ensure that
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909135244.122747-1-selvin.xavier@broadcom.com?part=8
prev parent reply other threads:[~2026-09-09 9:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 13:52 [PATCH for-rc v2 1/8] RDMA/bnxt_re: Reject executable mappings of the DBR and toggle pages Selvin Xavier
2026-09-09 8:42 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 2/8] RDMA/bnxt_re: Detect wrong sge_len passed for inline Selvin Xavier
2026-09-09 8:47 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 3/8] RDMA/bnxt_re: Validate num_sge in bnxt_re_post_srq_recv() Selvin Xavier
2026-09-09 8:50 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 4/8] RDMA/bnxt_re: Validate SRQ max_sge at create time Selvin Xavier
2026-09-09 9:00 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 5/8] RDMA/bnxt_re: Fix rdev lifetime races in suspend/resume/shutdown Selvin Xavier
2026-09-09 8:50 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 6/8] RDMA/bnxt_re: Fix the PD and DPI table size Selvin Xavier
2026-09-09 8:48 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 7/8] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection Selvin Xavier
2026-09-09 8:56 ` sashiko-bot
2026-09-09 13:52 ` [PATCH for-rc v2 8/8] RDMA/bnxt_re: Check is_in_used before trusting RCFW completion Selvin Xavier
2026-09-09 9:03 ` 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=20260909090312.3F0F01F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=selvin.xavier@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.