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: Thu, 11 Jun 2026 16:17:23 -0300 [thread overview]
Message-ID: <20260611191723.GA1516987@nvidia.com> (raw)
In-Reply-To: <20260611-maher-sec-fixes-v1-2-cd8eb2542869@nvidia.com>
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.
Jason
prev parent reply other threads:[~2026-06-11 19:17 UTC|newest]
Thread overview: 5+ 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 [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=20260611191723.GA1516987@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.