Re: [PATCH rdma-rc 8/9] RDMA/mlx5: Fix integer overflow while resizing CQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 25, 2018 at 01:39:55PM +0200, Leon Romanovsky wrote:
  
> +	/* check multiplication overflow */
> +	if (ucmd.cqe_size && SIZE_MAX / (size_t)ucmd.cqe_size <= entries - 1)
> +		return -EINVAL;

This division is done on size_t, pretty sure the cast isn't needed.

>  	umem = ib_umem_get(context, ucmd.buf_addr, entries * ucmd.cqe_size,

But the protected multiplication is done on (int) * (u16)

So this isn't going to work properly.

Make entries size_t.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux