Skip to content

Commit 0889d13

Browse files
hreineckekeithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 34485c3 commit 0889d13

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/target/tcp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ static int nvmet_tcp_handle_icreq(struct nvmet_tcp_queue *queue)
898898
pr_err("bad nvme-tcp pdu length (%d)\n",
899899
le32_to_cpu(icreq->hdr.plen));
900900
nvmet_tcp_fatal_error(queue);
901+
return -EPROTO;
901902
}
902903

903904
if (icreq->pfv != NVME_TCP_PFV_1_0) {

0 commit comments

Comments
 (0)