All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Edward Srouji <edwards@nvidia.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Jack Morgenstein <jackm@dev.mellanox.co.il>,
	Roland Dreier <roland@purestorage.com>,
	Eli Cohen <eli@mellanox.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Maher Sanalla <msanalla@nvidia.com>
Subject: Re: [PATCH rdma-next 2/2] RDMA/mlx5: Fix integer overflow of user QP buffer size
Date: Mon, 15 Jun 2026 10:38:46 -0300	[thread overview]
Message-ID: <20260615133846.GK1962447@nvidia.com> (raw)
In-Reply-To: <dce83cca-79c3-44fe-ac05-0eeeeaa60890@nvidia.com>

On Sun, Jun 14, 2026 at 02:23:00PM +0300, Edward Srouji wrote:
> 
> 
> On 6/11/2026 10:17 PM, Jason Gunthorpe wrote:
> > On Thu, Jun 11, 2026 at 03:50:43PM +0300, Edward Srouji wrote:
> > > @@ -664,11 +666,36 @@ static int set_user_buf_size(struct mlx5_ib_dev *dev,
> > >   	if (attr->qp_type == IB_QPT_RAW_PACKET ||
> > >   	    qp->flags & IB_QP_CREATE_SOURCE_QPN) {
> > > -		base->ubuffer.buf_size = qp->rq.wqe_cnt << qp->rq.wqe_shift;
> > > -		qp->raw_packet_qp.sq.ubuffer.buf_size = qp->sq.wqe_cnt << 6;
> > > +		if (check_shl_overflow(qp->rq.wqe_cnt, qp->rq.wqe_shift,
> > > +				       &base->ubuffer.buf_size)) {
> > > +			mlx5_ib_warn(dev, "rq buf size overflow: wqe_cnt %d wqe_shift %d\n",
> > > +				     qp->rq.wqe_cnt, qp->rq.wqe_shift);
> > > +			return -EINVAL;
> > 
> > No prints triggerable by uapi.
> > 
> Right, will drop them.
> Note that set_user_buf_size() already has a pre-existing mlx5_ib_warn()
> prints, which is equally uapi-triggerable.
> Should we clean that up in a separate patch? Should we drop such prints
> entirely? or convert them to mlx5_ib_dbg()?

Yes clean them up, up to you if you want dbg versions

Jason

      reply	other threads:[~2026-06-15 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 12:50 [PATCH rdma-next 0/2] RDMA/mlx5: Fix user-triggerable overflows in QP creation Edward Srouji
2026-06-11 12:50 ` [PATCH rdma-next 1/2] RDMA/mlx5: Fix undefined shift of user RQ WQE size Edward Srouji
2026-06-11 19:19   ` Jason Gunthorpe
2026-06-11 12:50 ` [PATCH rdma-next 2/2] RDMA/mlx5: Fix integer overflow of user QP buffer size Edward Srouji
2026-06-11 19:17   ` Jason Gunthorpe
2026-06-14 11:23     ` Edward Srouji
2026-06-15 13:38       ` 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=20260615133846.GK1962447@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=edwards@nvidia.com \
    --cc=eli@mellanox.com \
    --cc=jackm@dev.mellanox.co.il \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=msanalla@nvidia.com \
    --cc=ogerlitz@mellanox.com \
    --cc=roland@purestorage.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.