linux-stable/drivers/infiniband/hw/mlx4
Maor Gottlieb 2adcb4c5a5 RDMA: Verify port when creating flow rule
Validate port value provided by the user and with that remove no longer
needed validation by the driver.  The missing check in the mlx5_ib driver
could cause to the below oops.

Call trace:
  _create_flow_rule+0x2d4/0xf28 [mlx5_ib]
  mlx5_ib_create_flow+0x2d0/0x5b0 [mlx5_ib]
  ib_uverbs_ex_create_flow+0x4cc/0x624 [ib_uverbs]
  ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xd4/0x150 [ib_uverbs]
  ib_uverbs_cmd_verbs.isra.7+0xb28/0xc50 [ib_uverbs]
  ib_uverbs_ioctl+0x158/0x1d0 [ib_uverbs]
  do_vfs_ioctl+0xd0/0xaf0
  ksys_ioctl+0x84/0xb4
  __arm64_sys_ioctl+0x28/0xc4
  el0_svc_common.constprop.3+0xa4/0x254
  el0_svc_handler+0x84/0xa0
  el0_svc+0x10/0x26c
 Code: b9401260 f9615681 51000400 8b001c20 (f9403c1a)

Fixes: 436f2ad05a ("IB/core: Export ib_create/destroy_flow through uverbs")
Link: https://lore.kernel.org/r/faad30dc5219a01727f47db3dc2f029d07c82c00.1623309971.git.leonro@nvidia.com
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-06-10 08:59:33 -03:00
..
ah.c RDMA: Restore ability to fail on AH destroy 2020-09-09 13:57:22 -03:00
alias_GUID.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
cm.c IB/mlx4: Convert rej_tmout radix-tree to XArray 2020-10-09 12:34:49 -03:00
cq.c RDMA/mlx4: Use ib_umem_num_dma_blocks() 2020-09-11 10:24:54 -03:00
doorbell.c IB: Allow calls to ib_umem_get from kernel ULPs 2020-01-16 16:14:28 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
main.c RDMA: Verify port when creating flow rule 2021-06-10 08:59:33 -03:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mcg.c RDMA: Manual changes for sysfs_emit and neatening 2020-10-30 21:03:52 -03:00
mlx4_ib.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mr.c RDMA/uverbs: Allow drivers to create a new HW object during rereg_mr 2020-12-07 14:06:23 -04:00
qp.c RDMA/mlx4: Remove an unused variable 2021-04-20 16:32:33 -03:00
srq.c RDMA: Check srq_type during create_srq 2020-10-26 19:27:58 -03:00
sysfs.c IB/mlx4: Use port iterator and validation APIs 2021-02-02 19:25:40 -04:00