All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Selvin Xavier <selvin.xavier@broadcom.com>
Cc: sashiko-reviews@lists.linux.dev, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-rc v3 5/8] RDMA/bnxt_re: Validate num_sge in bnxt_re_post_srq_recv()
Date: Tue, 29 Sep 2026 11:33:47 +0300	[thread overview]
Message-ID: <20260929083347.GH563127@unreal> (raw)
In-Reply-To: <CA+sbYW0A0gS2dhgLF18etO9mnMzhxvLbDmru6v17t+7qQ4Hizw@mail.gmail.com>

On Tue, Sep 22, 2026 at 10:09:52AM +0530, Selvin Xavier wrote:
> On Tue, Sep 22, 2026 at 6:37 AM <sashiko-bot@kernel.org> wrote:
> >
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [High] rdma/bnxt_re: un-ratelimited error log in spinlock allows DoS
> > --
> >
> > commit bb7479cd7b3a22e9b0e6b2862ab2b9133790528b
> > Author: Selvin Xavier <selvin.xavier@broadcom.com>
> >
> > RDMA/bnxt_re: Validate num_sge in bnxt_re_post_srq_recv()
> >
> > Add a check if max sge for SRQ is exceeding the device maximum.
> >
> > > diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> > > index c35ed6ed03516..3cccef8e2e837 100644
> > > --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> > > +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> > > @@ -2399,6 +2399,13 @@ int bnxt_re_post_srq_recv(struct ib_srq *ib_srq, const struct ib_recv_wr *wr,
> > >               /* Transcribe each ib_recv_wr to qplib_swqe */
> > >               wqe.flags = 0;
> > >               wqe.num_sge = wr->num_sge;
> > > +             if (wr->num_sge > srq->qplib_srq.max_sge) {
> > > +                     ibdev_err(&srq->rdev->ibdev,
> > > +                               "Limit exceeded for SRQ Receive SGEs");
> >
> > [Severity: High]
> > Is it safe to use an un-ratelimited ibdev_err() here while holding the
> > srq->lock spinlock with interrupts disabled in bnxt_re_post_srq_recv()?
> >
> > Since an unprivileged user can repeatedly invoke the RDMA uverbs API with a
> > wr->num_sge larger than srq->qplib_srq.max_sge, could this regression allow a
> > local user to flood the kernel log buffer and potentially cause soft lockups?
>  It is possible to reach the kernel driver using an under privilaged
> user, but there is no support in rdma-core/libbnxt_re to call
> ibv_cmd_post_srq_recv and this code path will not be reached as of
> now. So I think this can be ignored.

We cannot assume that rdma-core is trusted. Anyone can build it locally and use it
to interact with the kernel. In addition, syzkaller uses our UAPI structures
and commands directly, without involving rdma-core.

Thanks

> >
> > > +                     rc = -EINVAL;
> > > +                     *bad_wr = wr;
> > > +                     break;
> > > +             }
> > >               bnxt_re_build_sgl(wr->sg_list, wqe.sg_list, wr->num_sge);
> > >               wqe.wr_id = wr->wr_id;
> > >               wqe.type = BNXT_QPLIB_SWQE_TYPE_RECV;
> >
> > --
> > Sashiko AI review · https://sashiko.dev/#/patchset/20260922061230.7909-1-selvin.xavier@broadcom.com?part=5



  reply	other threads:[~2026-09-29  8:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  6:12 [PATCH for-rc v3 0/8] RDMA/bnxt_re: Fix input validation and Selvin Xavier
2026-09-22  6:12 ` [PATCH for-rc v3 1/8] RDMA/bnxt_re: Fix integer overflow in send payload size computation Selvin Xavier
2026-09-22  1:09   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 2/8] RDMA/bnxt_re: Detect wrong sge_len passed for inline Selvin Xavier
2026-09-22  1:08   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 3/8] RDMA/bnxt_re: Validate SRQ max_sge at create time Selvin Xavier
2026-09-22  1:07   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 4/8] RDMA/bnxt_re: Initialize wqe.flags in bnxt_re_post_srq_recv() Selvin Xavier
2026-09-22  1:02   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 5/8] RDMA/bnxt_re: Validate num_sge " Selvin Xavier
2026-09-22  1:07   ` sashiko-bot
2026-09-22  4:39     ` Selvin Xavier
2026-09-29  8:33       ` Leon Romanovsky [this message]
2026-09-22  6:12 ` [PATCH for-rc v3 6/8] RDMA/bnxt_re: Serialize dcb_wq access against async notifier Selvin Xavier
2026-09-22  1:05   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 7/8] RDMA/bnxt_re: Fix the PD and DPI table size Selvin Xavier
2026-09-22  1:01   ` sashiko-bot
2026-09-22  6:12 ` [PATCH for-rc v3 8/8] RDMA/bnxt_re: Use bnxt_ext_stats_supported for counter count selection Selvin Xavier
2026-09-22  1:06   ` sashiko-bot
2026-09-29  8:34 ` (subset) [PATCH for-rc v3 0/8] RDMA/bnxt_re: Fix input validation and Leon Romanovsky
2026-09-29  8:36 ` Leon Romanovsky
2026-10-01  5:21   ` Selvin Xavier
2026-09-29  8:42 ` (subset) " Leon Romanovsky

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=20260929083347.GH563127@unreal \
    --to=leon@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.