1
0
Fork 0
alistair23-linux/drivers/nvme/host
Chao Leng a7aa5d578f nvme-rdma: fix crash when connect rejected
[ Upstream commit 43efdb8e87 ]

A crash can happened when a connect is rejected.   The host establishes
the connection after received ConnectReply, and then continues to send
the fabrics Connect command.  If the controller does not receive the
ReadyToUse capsule, host may receive a ConnectReject reply.

Call nvme_rdma_destroy_queue_ib after the host received the
RDMA_CM_EVENT_REJECTED event.  Then when the fabrics Connect command
times out, nvme_rdma_timeout calls nvme_rdma_complete_rq to fail the
request.  A crash happenes due to use after free in
nvme_rdma_complete_rq.

nvme_rdma_destroy_queue_ib is redundant when handling the
RDMA_CM_EVENT_REJECTED event as nvme_rdma_destroy_queue_ib is already
called in connection failure handler.

Signed-off-by: Chao Leng <lengchao@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-11-05 11:43:22 +01:00
..
Kconfig nvme-tcp: fix kconfig dependency warning when !CRYPTO 2020-10-01 13:18:19 +02:00
Makefile nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
core.c nvme-core: put ctrl ref when module ref get fail 2020-10-14 10:33:00 +02:00
fabrics.c nvme-fabrics: don't check state NVME_CTRL_NEW for request acceptance 2020-09-17 13:47:47 +02:00
fabrics.h nvme: Remove ADMIN_ONLY state 2019-10-14 23:21:44 +09:00
fault_inject.c nvme: enable to inject errors into admin commands 2019-06-21 11:15:50 +02:00
fc.c nvme-fc: fail new connections to a deleted host or remote port 2020-10-07 08:01:27 +02:00
lightnvm.c lightnvm: move metadata mapping to lower level driver 2019-08-06 08:20:10 -06:00
multipath.c nvme-multipath: do not reset on unknown status 2020-10-01 13:17:49 +02:00
nvme.h nvme: consolidate chunk_sectors settings 2020-10-07 08:01:30 +02:00
pci.c nvme-pci: disable the write zeros command for Intel 600P/P3100 2020-10-29 09:57:25 +01:00
rdma.c nvme-rdma: fix crash when connect rejected 2020-11-05 11:43:22 +01:00
tcp.c nvme-tcp: check page by sendpage_ok() before calling kernel_sendpage() 2020-10-14 10:33:01 +02:00
trace.c nvme: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvme-trace: print result and status in hex format 2019-06-21 11:12:37 +02:00