Commit 0889d13b authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Keith Busch

nvmet-tcp: do not continue for invalid icreq

When the length check for an icreq sqe fails we should not
continue processing but rather return immediately as all
other contents of that sqe cannot be relied on.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 34485c37
...@@ -898,6 +898,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue) ...@@ -898,6 +898,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)
pr_err("bad nvme-tcp pdu length (%d)\n", pr_err("bad nvme-tcp pdu length (%d)\n",
le32_to_cpu(icreq->hdr.plen)); le32_to_cpu(icreq->hdr.plen));
nvmet_tcp_fatal_error(queue); nvmet_tcp_fatal_error(queue);
return -EPROTO;
} }
if (icreq->pfv != NVME_TCP_PFV_1_0) { if (icreq->pfv != NVME_TCP_PFV_1_0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment