linux/drivers/infiniband/hw/mlx5
Aharon Landau 5508546631 RDMA/mlx5: Initialize the ODP xarray when creating an ODP MR
Normally the zero fill would hide the missing initialization, but an
errant set to desc_size in reg_create() causes a crash:

  BUG: unable to handle page fault for address: 0000000800000000
  PGD 0 P4D 0
  Oops: 0000 [#1] SMP PTI
  CPU: 5 PID: 890 Comm: ib_write_bw Not tainted 5.15.0-rc4+ #47
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
  RIP: 0010:mlx5_ib_dereg_mr+0x14/0x3b0 [mlx5_ib]
  Code: 48 63 cd 4c 89 f7 48 89 0c 24 e8 37 30 03 e1 48 8b 0c 24 eb a0 90 0f 1f 44 00 00 41 56 41 55 41 54 55 53 48 89 fb 48 83 ec 30 <48> 8b 2f 65 48 8b 04 25 28 00 00 00 48 89 44 24 28 31 c0 8b 87 c8
  RSP: 0018:ffff88811afa3a60 EFLAGS: 00010286
  RAX: 000000000000001c RBX: 0000000800000000 RCX: 0000000000000000
  RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000800000000
  RBP: 0000000800000000 R08: 0000000000000000 R09: c0000000fffff7ff
  R10: ffff88811afa38f8 R11: ffff88811afa38f0 R12: ffffffffa02c7ac0
  R13: 0000000000000000 R14: ffff88811afa3cd8 R15: ffff88810772fa00
  FS:  00007f47b9080740(0000) GS:ffff88852cd40000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000800000000 CR3: 000000010761e003 CR4: 0000000000370ea0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   mlx5_ib_free_odp_mr+0x95/0xc0 [mlx5_ib]
   mlx5_ib_dereg_mr+0x128/0x3b0 [mlx5_ib]
   ib_dereg_mr_user+0x45/0xb0 [ib_core]
   ? xas_load+0x8/0x80
   destroy_hw_idr_uobject+0x1a/0x50 [ib_uverbs]
   uverbs_destroy_uobject+0x2f/0x150 [ib_uverbs]
   uobj_destroy+0x3c/0x70 [ib_uverbs]
   ib_uverbs_cmd_verbs+0x467/0xb00 [ib_uverbs]
   ? uverbs_finalize_object+0x60/0x60 [ib_uverbs]
   ? ttwu_queue_wakelist+0xa9/0xe0
   ? pty_write+0x85/0x90
   ? file_tty_write.isra.33+0x214/0x330
   ? process_echoes+0x60/0x60
   ib_uverbs_ioctl+0xa7/0x110 [ib_uverbs]
   __x64_sys_ioctl+0x10d/0x8e0
   ? vfs_write+0x17f/0x260
   do_syscall_64+0x3c/0x80
   entry_SYSCALL_64_after_hwframe+0x44/0xae

Add the missing xarray initialization and remove the desc_size set.

Fixes: a639e66703 ("RDMA/mlx5: Zero out ODP related items in the mlx5_ib_mr")
Link: https://lore.kernel.org/r/a4846a11c9de834663e521770da895007f9f0d30.1634642730.git.leonro@nvidia.com
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-10-19 20:19:59 -03:00
..
ah.c
cmd.c RDMA/mlx5: Move all DM logic to separate file 2021-04-13 19:36:36 -03:00
cmd.h RDMA/mlx5: Move all DM logic to separate file 2021-04-13 19:36:36 -03:00
cong.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
counters.c RDMA: Split the alloc_hw_stats() ops to port and device variants 2021-06-16 20:58:29 -03:00
counters.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
cq.c Merge branch 'sg_nents' into rdma.git for-next 2021-08-30 09:49:59 -03:00
devx.c Merge branch 'sg_nents' into rdma.git for-next 2021-08-30 09:49:59 -03:00
devx.h
dm.c RDMA/mlx5: Verify that DM operation is reasonable 2021-05-17 13:52:47 -03:00
dm.h RDMA/mlx5: Expose UAPI to query DM 2021-04-13 19:36:37 -03:00
doorbell.c RDMA: Use the sg_table directly and remove the opencoded version from umem 2021-08-24 19:52:40 -03:00
fs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
fs.h
gsi.c RDMA: Globally allocate and release QP memory 2021-08-03 13:44:27 -03:00
ib_rep.c RDMA/mlx5: Add shared FDB support 2021-08-05 13:49:24 -07:00
ib_rep.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
ib_virt.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
Kconfig
mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
main.c RDMA v5.15 merge window Pull Request 2021-09-02 14:47:21 -07:00
Makefile RDMA/mlx5: Move all DM logic to separate file 2021-04-13 19:36:36 -03:00
mem.c
mlx5_ib.h RDMA: Globally allocate and release QP memory 2021-08-03 13:44:27 -03:00
mr.c RDMA/mlx5: Initialize the ODP xarray when creating an ODP MR 2021-10-19 20:19:59 -03:00
odp.c RDMA v5.14 merge window Pull Request 2021-07-01 14:54:03 -07:00
qos.c
qp.c RDMA/mlx5: Set user priority for DCT 2021-10-06 16:39:52 -03:00
qp.h
qpc.c RDMA/mlx5: Support SQD2RTS for modify QP 2021-05-20 11:41:07 -03:00
restrack.c RDMA/mlx5: Assign dev to DM MR 2020-12-07 15:52:54 -04:00
restrack.h
srq.c RDMA/mlx5: Remove unused parameter udata 2021-05-20 11:52:17 -03:00
srq.h
srq_cmd.c
std_types.c RDMA/mlx5: Fill port info based on the relevant eswitch 2021-08-05 13:49:24 -07:00
wr.c RDMA/mlx5: Enable Relaxed Ordering by default for kernel ULPs 2021-06-21 12:33:08 -03:00
wr.h