linux/drivers/nvme/target
Ziye Yang f9af5758b1 nvmet-tcp: Fix NULL dereference when a connect data comes in h2cdata pdu
[ Upstream commit a6ce7d7b4a ]

When handling commands without in-capsule data, we assign the ttag
assuming we already have the queue commands array allocated (based
on the queue size information in the connect data payload). However
if the connect itself did not send the connect data in-capsule we
have yet to allocate the queue commands,and we will assign a bogus
ttag and suffer a NULL dereference when we receive the corresponding
h2cdata pdu.

Fix this by checking if we already allocated commands before
dereferencing it when handling h2cdata, if we didn't, its for sure a
connect and we should use the preallocated connect command.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-17 13:47:47 +02:00
..
Kconfig
Makefile
admin-cmd.c
configfs.c
core.c
discovery.c
fabrics-cmd.c
fc.c
fcloop.c
io-cmd-bdev.c
io-cmd-file.c
loop.c
nvmet.h
rdma.c
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
trace.h