1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/infiniband/hw/mlx5
Alaa Hleihel 2ba0aa2fee IB/mlx5: Fix initializing CQ fragments buffer
The function init_cq_frag_buf() can be called to initialize the current CQ
fragments buffer cq->buf, or the temporary cq->resize_buf that is filled
during CQ resize operation.

However, the offending commit started to use function get_cqe() for
getting the CQEs, the issue with this change is that get_cqe() always
returns CQEs from cq->buf, which leads us to initialize the wrong buffer,
and in case of enlarging the CQ we try to access elements beyond the size
of the current cq->buf and eventually hit a kernel panic.

 [exception RIP: init_cq_frag_buf+103]
  [ffff9f799ddcbcd8] mlx5_ib_resize_cq at ffffffffc0835d60 [mlx5_ib]
  [ffff9f799ddcbdb0] ib_resize_cq at ffffffffc05270df [ib_core]
  [ffff9f799ddcbdc0] llt_rdma_setup_qp at ffffffffc0a6a712 [llt]
  [ffff9f799ddcbe10] llt_rdma_cc_event_action at ffffffffc0a6b411 [llt]
  [ffff9f799ddcbe98] llt_rdma_client_conn_thread at ffffffffc0a6bb75 [llt]
  [ffff9f799ddcbec8] kthread at ffffffffa66c5da1
  [ffff9f799ddcbf50] ret_from_fork_nospec_begin at ffffffffa6d95ddd

Fix it by getting the needed CQE by calling mlx5_frag_buf_get_wqe() that
takes the correct source buffer as a parameter.

Fixes: 388ca8be00 ("IB/mlx5: Implement fragmented completion queue (CQ)")
Link: https://lore.kernel.org/r/90a0e8c924093cfa50a482880ad7e7edb73dc19a.1623309971.git.leonro@nvidia.com
Signed-off-by: Alaa Hleihel <alaa@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-06-10 08:59:34 -03:00
..
ah.c RDMA: Restore ability to fail on AH destroy 2020-09-09 13:57:22 -03:00
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: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
counters.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
cq.c IB/mlx5: Fix initializing CQ fragments buffer 2021-06-10 08:59:34 -03:00
devx.c RDMA/mlx5: Fix query DCT via DEVX 2021-05-19 13:27:54 -03:00
devx.h RDMA/mlx5: Cleanup DEVX initialization flow 2020-07-07 14:05:51 -03:00
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/mlx5: Use different doorbell memory for different processes 2021-06-03 14:19:53 -03:00
fs.c RDMA: Verify port when creating flow rule 2021-06-10 08:59:33 -03:00
fs.h RDMA/mlx5: Separate flow steering logic from main.c 2020-07-07 14:05:51 -03:00
gsi.c RDMA/mlx5: Delete not needed GSI QP signal QP type 2020-09-29 13:09:49 -03:00
ib_rep.c Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2021-04-12 13:49:48 -03: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 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/mlx5: Recover from fatal event in dual port mode 2021-05-17 13:52:47 -03:00
Makefile RDMA/mlx5: Move all DM logic to separate file 2021-04-13 19:36:36 -03:00
mem.c RDMA/mlx5: Silence the overflow warning while building offset mask 2020-11-26 15:49:05 -04:00
mlx5_ib.h Merge branch 'mlx5_memic_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2021-04-13 19:37:17 -03:00
mr.c RDMA/mlx5: Delete right entry from MR signature database 2021-06-10 08:59:34 -03:00
odp.c RDMA/mlx5: Set ODP caps only if device profile support ODP 2021-03-26 11:57:38 -03:00
qos.c RDMA/core: Allow the ioctl layer to abort a fully created uobject 2020-05-21 20:10:46 -03:00
qp.c RDMA merge window pull request 2021-05-01 09:15:05 -07:00
qp.h RDMA: Restore ability to return error for destroy WQ 2020-09-09 14:14:29 -03:00
qpc.c RDMA: Restore ability to return error for destroy WQ 2020-09-09 14:14:29 -03:00
restrack.c RDMA/mlx5: Assign dev to DM MR 2020-12-07 15:52:54 -04:00
restrack.h RDMA/mlx5: Separate restrack callbacks initialization from main.c 2020-07-07 14:05:51 -03:00
srq.c RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
srq.h RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
srq_cmd.c RDMA/mlx5: Lower setting the umem's PAS for SRQ 2020-11-16 16:53:30 -04:00
std_types.c RDMA/mlx5: Expose private query port 2021-04-20 17:00:18 -03:00
wr.c IB/mlx5: Move mlx5_port_caps from mlx5_core_dev to mlx5_ib_dev 2021-02-05 12:06:00 -04:00
wr.h RDMA/mlx5: Move all WR logic from qp.c to separate file 2020-05-06 17:42:45 -03:00