WSL2-Linux-Kernel/drivers/infiniband/sw/rxe
Leon Romanovsky dc07628bd2 RDMA/rxe: Return CQE error if invalid lkey was supplied
RXE is missing update of WQE status in LOCAL_WRITE failures.  This caused
the following kernel panic if someone sent an atomic operation with an
explicitly wrong lkey.

[leonro@vm ~]$ mkt test
test_atomic_invalid_lkey (tests.test_atomic.AtomicTest) ...
 WARNING: CPU: 5 PID: 263 at drivers/infiniband/sw/rxe/rxe_comp.c:740 rxe_completer+0x1a6d/0x2e30 [rdma_rxe]
 Modules linked in: crc32_generic rdma_rxe ip6_udp_tunnel udp_tunnel rdma_ucm rdma_cm ib_umad ib_ipoib iw_cm ib_cm mlx5_ib ib_uverbs ib_core mlx5_core ptp pps_core
 CPU: 5 PID: 263 Comm: python3 Not tainted 5.13.0-rc1+ #2936
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
 RIP: 0010:rxe_completer+0x1a6d/0x2e30 [rdma_rxe]
 Code: 03 0f 8e 65 0e 00 00 3b 93 10 06 00 00 0f 84 82 0a 00 00 4c 89 ff 4c 89 44 24 38 e8 2d 74 a9 e1 4c 8b 44 24 38 e9 1c f5 ff ff <0f> 0b e9 0c e8 ff ff b8 05 00 00 00 41 bf 05 00 00 00 e9 ab e7 ff
 RSP: 0018:ffff8880158af090 EFLAGS: 00010246
 RAX: 0000000000000000 RBX: ffff888016a78000 RCX: ffffffffa0cf1652
 RDX: 1ffff9200004b442 RSI: 0000000000000004 RDI: ffffc9000025a210
 RBP: dffffc0000000000 R08: 00000000ffffffea R09: ffff88801617740b
 R10: ffffed1002c2ee81 R11: 0000000000000007 R12: ffff88800f3b63e8
 R13: ffff888016a78008 R14: ffffc9000025a180 R15: 000000000000000c
 FS:  00007f88b622a740(0000) GS:ffff88806d540000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007f88b5a1fa10 CR3: 000000000d848004 CR4: 0000000000370ea0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
 Call Trace:
  rxe_do_task+0x130/0x230 [rdma_rxe]
  rxe_rcv+0xb11/0x1df0 [rdma_rxe]
  rxe_loopback+0x157/0x1e0 [rdma_rxe]
  rxe_responder+0x5532/0x7620 [rdma_rxe]
  rxe_do_task+0x130/0x230 [rdma_rxe]
  rxe_rcv+0x9c8/0x1df0 [rdma_rxe]
  rxe_loopback+0x157/0x1e0 [rdma_rxe]
  rxe_requester+0x1efd/0x58c0 [rdma_rxe]
  rxe_do_task+0x130/0x230 [rdma_rxe]
  rxe_post_send+0x998/0x1860 [rdma_rxe]
  ib_uverbs_post_send+0xd5f/0x1220 [ib_uverbs]
  ib_uverbs_write+0x847/0xc80 [ib_uverbs]
  vfs_write+0x1c5/0x840
  ksys_write+0x176/0x1d0
  do_syscall_64+0x3f/0x80
  entry_SYSCALL_64_after_hwframe+0x44/0xae

Fixes: 8700e3e7c4 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/11e7b553f3a6f5371c6bb3f57c494bb52b88af99.1620711734.git.leonro@nvidia.com
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-05-17 13:52:47 -03:00
..
Kconfig RDMA/rxe: Fix missing kconfig dependency on CRYPTO 2021-03-01 14:46:31 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rxe.c Merge branch 'mlx5_active_speed' into rdma.git for-next 2020-09-18 10:31:45 -03:00
rxe.h Merge branch 'mlx5_active_speed' into rdma.git for-next 2020-09-18 10:31:45 -03:00
rxe_av.c RDMA/rxe: Fix a bug in rxe_fill_ip_info() 2021-04-21 16:09:04 -03:00
rxe_comp.c RDMA/rxe: Return CQE error if invalid lkey was supplied 2021-05-17 13:52:47 -03:00
rxe_cq.c RDMA/rxe: Use acquire/release for memory ordering 2020-12-11 19:57:48 -04:00
rxe_hdr.h RDMA/rxe: Remove unused pkt->offset 2021-02-16 14:42:59 -04:00
rxe_hw_counters.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
rxe_hw_counters.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
rxe_icrc.c RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_loc.h RDMA/rxe: Remove rxe_dma_device declaration 2021-03-31 14:45:50 -03:00
rxe_mcast.c RDMA/rxe: Fix misleading comments and names 2021-01-28 15:29:55 -04:00
rxe_mmap.c RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_mr.c RDMA/rxe: Split MEM into MR and MW 2021-03-30 17:11:30 -03:00
rxe_net.c RDMA/rxe: Fix missed IB reference counting in loopback 2021-03-05 14:11:02 -04:00
rxe_net.h RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_opcode.c RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_opcode.h RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_param.h RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_pool.c RDMA/rxe: Split MEM into MR and MW 2021-03-30 17:11:30 -03:00
rxe_pool.h RDMA/rxe: Remove unneeded pool->state 2021-01-28 15:29:56 -04:00
rxe_qp.c RDMA/rxe: Clear all QP fields if creation failed 2021-05-11 16:58:14 -03:00
rxe_queue.c RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_queue.h RDMA/rxe: Use acquire/release for memory ordering 2020-12-11 19:57:48 -04:00
rxe_recv.c RDMA/rxe: Fix extra deref in rxe_rcv_mcast_pkt() 2021-03-05 14:15:18 -04:00
rxe_req.c RDMA/rxe: Split MEM into MR and MW 2021-03-30 17:11:30 -03:00
rxe_resp.c RDMA/rxe: Fix missing acks from responder 2021-04-08 15:59:28 -03:00
rxe_srq.c RDMA/rxe: Add SPDX hdrs to rxe source files 2020-08-31 12:20:02 -03:00
rxe_sysfs.c Merge branch 'mlx5_active_speed' into rdma.git for-next 2020-09-18 10:31:45 -03:00
rxe_task.c RDMA/rxe: Convert tasklets to use new tasklet_setup() API 2020-09-03 12:01:53 -03:00
rxe_task.h RDMA/rxe: Convert tasklets to use new tasklet_setup() API 2020-09-03 12:01:53 -03:00
rxe_verbs.c RDMA/rxe: Split MEM into MR and MW 2021-03-30 17:11:30 -03:00
rxe_verbs.h RDMA/rxe: Split MEM into MR and MW 2021-03-30 17:11:30 -03:00