kernel-fxtec-pro1x/drivers/nvme/target
Israel Rukshin 5fd750e826 nvmet-rdma: fix double free of rdma queue
[ Upstream commit 21f9024355e58772ec5d7fc3534aa5e29d72a8b6 ]

In case rdma accept fails at nvmet_rdma_queue_connect(), release work is
scheduled. Later on, a new RDMA CM event may arrive since we didn't
destroy the cm-id and call nvmet_rdma_queue_connect_fail(), which
schedule another release work. This will cause calling
nvmet_rdma_free_queue twice. To fix this we implicitly destroy the cm_id
with non-zero ret code, which guarantees that new rdma_cm events will
not arrive afterwards. Also add a qp pointer to nvmet_rdma_queue
structure, so we can use it when the cm_id pointer is NULL or was
destroyed.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Suggested-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Max Gurtovoy <maxg@mellanox.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-10-01 13:14:41 +02:00
..
admin-cmd.c
configfs.c
core.c
discovery.c
fabrics-cmd.c
fc.c nvmet-fc: Fix a missed _irqsave version of spin_lock in 'nvmet_fc_fod_op_done()' 2020-09-09 19:04:26 +02:00
fcloop.c
io-cmd-bdev.c
io-cmd-file.c
Kconfig
loop.c
Makefile
nvmet.h
rdma.c nvmet-rdma: fix double free of rdma queue 2020-10-01 13:14:41 +02:00