diff options
author | Hannes Reinecke <hare@suse.de> | 2024-03-08 08:11:05 +0100 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2024-03-08 06:49:57 -0800 |
commit | 0889d13b9e1cbef49e802ae09f3b516911ad82a1 (patch) | |
tree | 3a494a2f56216669f88e8531d7cfd5fe9b655261 /drivers/nvme | |
parent | 34485c37ea931d4a086701de1d61a986b9707b7d (diff) |
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: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/tcp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index c8655fc5aa5b..022d17bd36bf 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -898,6 +898,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue) pr_err("bad nvme-tcp pdu length (%d)\n", le32_to_cpu(icreq->hdr.plen)); nvmet_tcp_fatal_error(queue); + return -EPROTO; } if (icreq->pfv != NVME_TCP_PFV_1_0) { |