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 1/2] RDMA/mlx5: Fix undefined shift of user RQ WQE size
Date: Thu, 11 Jun 2026 16:19:51 -0300	[thread overview]
Message-ID: <20260611191951.GA1519234@nvidia.com> (raw)
In-Reply-To: <20260611-maher-sec-fixes-v1-1-cd8eb2542869@nvidia.com>

On Thu, Jun 11, 2026 at 03:50:42PM +0300, Edward Srouji wrote:
> From: Maher Sanalla <msanalla@nvidia.com>
> 
> set_rq_size() computes the RQ WQE size as "1 << rq_wqe_shift" based on
> the user-provided rq_wqe_shift, which is only checked to be greater than
> 32, so shifts of 32 are still accepted. A shift of 31 also overflows a
> signed integer, leading to undefined behavior.
> 
> Use check_shl_overflow() to compute the RQ WQE size and reject any
> invalid values.
> 
> Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
> Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
> Signed-off-by: Edward Srouji <edwards@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

Applied just this one, please resend the other one

Thanks,
Jason

  reply	other threads:[~2026-06-11 19:20 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 [this message]
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

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=20260611191951.GA1519234@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.