RDMA/core: Sanitize WQ state received from the userspace
authorLeon Romanovsky <leonro@nvidia.com>
Wed, 19 May 2021 08:37:31 +0000 (11:37 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 2 Jun 2021 18:20:11 +0000 (15:20 -0300)
commitf97442887275d11c88c2899e720fe945c1f61488
treeb618ff69d5807b3ba8fc28e5b0575b34a63bf9aa
parent0e8558476faf02ec51256cad9c487c93c346198c
RDMA/core: Sanitize WQ state received from the userspace

The mlx4 and mlx5 implemented differently the WQ input checks.  Instead of
duplicating mlx4 logic in the mlx5, let's prepare the input in the central
place.

The mlx5 implementation didn't check for validity of state input.  It is
not real bug because our FW checked that, but still worth to fix.

Fixes: f213c0527210 ("IB/uverbs: Add WQ support")
Link: https://lore.kernel.org/r/ac41ad6a81b095b1a8ad453dcf62cf8d3c5da779.1621413310.git.leonro@nvidia.com
Reported-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/hw/mlx4/qp.c
drivers/infiniband/hw/mlx5/qp.c