Skip to contentSkip to conversation

nvmet-tcp: do not continue for invalid icreq

PATCH Applied Hannes Reinecke 4 participants 4 messages Mar 8, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmet-tcp: do not continue for invalid icreq

From: Hannes Reinecke <[email protected]>

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.

---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/tcp.c +1 -0
index 6a1e6bb80062..3d606ab01506 100644
@@ -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) {
Signature · 1 line
2.35.3