Re: [PATCH rdma-next 1/2] RDMA/mlx5: Fix undefined shift of user RQ WQE size
From: Jason Gunthorpe
Date: Thu Jun 11 2026 - 15:20:21 EST
On Thu, Jun 11, 2026 at 03:50:42PM +0300, Edward Srouji wrote:
> From: Maher Sanalla <msanalla@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Edward Srouji <edwards@xxxxxxxxxx>
> ---
> 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