nvme-tcp: fix a NULL deref when receiving a 0-length r2t PDU
authorSagi Grimberg <sagi@grimberg.me>
Mon, 15 Mar 2021 21:08:11 +0000 (14:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Mar 2021 08:04:07 +0000 (09:04 +0100)
commitb4f911e3a9821d20d2a440cdb5863b43242fcfbe
treed6a563bb8f700ff156582a35dd882b80c448eba5
parent7089cdfce32f9cf5397350140216bbc000347bae
nvme-tcp: fix a NULL deref when receiving a 0-length r2t PDU

commit fd0823f405090f9f410fc3e3ff7efb52e7b486fa upstream.

When the controller sends us a 0-length r2t PDU we should not attempt to
try to set up a h2cdata PDU but rather conclude that this is a buggy
controller (forward progress is not possible) and simply fail it
immediately.

Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver")
Reported-by: Belanger, Martin <Martin.Belanger@dell.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/host/tcp.c