1
0
Fork 0
alistair23-linux/drivers/nvme/target
Israel Rukshin 596b3423fd nvmet-rdma: Fix list_del corruption on queue establishment failure
[ Upstream commit 9ceb786353 ]

When a queue is in NVMET_RDMA_Q_CONNECTING state, it may has some
requests at rsp_wait_list. In case a disconnect occurs at this
state, no one will empty this list and will return the requests to
free_rsps list. Normally nvmet_rdma_queue_established() free those
requests after moving the queue to NVMET_RDMA_Q_LIVE state, but in
this case __nvmet_rdma_queue_disconnect() is called before. The
crash happens at nvmet_rdma_free_rsps() when calling
list_del(&rsp->free_list), because the request exists only at
the wait list. To fix the issue, simply clear rsp_wait_list when
destroying the queue.

Signed-off-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-19 18:26:15 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile nvmet: introduce target-side trace 2019-06-21 11:15:46 +02:00
admin-cmd.c nvmet: fix a wrong error status returned in error log page 2019-09-12 08:50:46 -07:00
configfs.c nvmet: Fix use-after-free bug when a port is removed 2019-07-31 17:57:06 -07:00
core.c nvmet: fix a NULL pointer dereference when tracing the flush command 2020-11-10 12:37:30 +01:00
discovery.c nvmet: Use PTR_ERR_OR_ZERO() in nvmet_init_discovery() 2019-09-12 08:50:46 -07:00
fabrics-cmd.c nvmet: Fix controller use after free 2020-02-11 04:35:08 -08:00
fc.c nvmet-fc: Fix a missed _irqsave version of spin_lock in 'nvmet_fc_fod_op_done()' 2020-09-09 19:12:27 +02:00
fcloop.c nvme-fc: Revert "add module to ops template to allow module references" 2020-04-17 10:50:10 +02:00
io-cmd-bdev.c nvmet: change ppl to lpp 2019-09-23 13:59:49 -07:00
io-cmd-file.c nvmet-file: clamp-down file namespace lba_shift 2019-04-25 16:51:19 +02:00
loop.c nvme: Fix ctrl use-after-free during sysfs deletion 2020-10-01 13:17:49 +02:00
nvmet.h nvmet: Fix use-after-free bug when a port is removed 2019-07-31 17:57:06 -07:00
rdma.c nvmet-rdma: Fix list_del corruption on queue establishment failure 2021-01-19 18:26:15 +01:00
tcp.c nvmet-tcp: Fix NULL dereference when a connect data comes in h2cdata pdu 2020-09-17 13:47:47 +02:00
trace.c nvmet: trace: parse Get LBA Status command in detail 2019-08-29 12:55:01 -07:00
trace.h nvmet: fix a NULL pointer dereference when tracing the flush command 2020-11-10 12:37:30 +01:00