All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet-tcp: do not continue for invalid icreq
@ 2024-03-08  7:11 Hannes Reinecke
  2024-03-08  9:57 ` Sagi Grimberg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hannes Reinecke @ 2024-03-08  7:11 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

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>
---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 6a1e6bb80062..3d606ab01506 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) {
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] nvmet-tcp: do not continue for invalid icreq
@ 2024-01-12  7:23 hare
  2024-01-15 12:54 ` Sagi Grimberg
  2024-01-15 22:11 ` Chaitanya Kulkarni
  0 siblings, 2 replies; 7+ messages in thread
From: hare @ 2024-01-12  7:23 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Sagi Grimberg, Keith Busch, linux-nvme, Hannes Reinecke

From: Hannes Reinecke <hare@suse.de>

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>
---
 drivers/nvme/target/tcp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 6a1e6bb80062..3d606ab01506 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) {
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-08 16:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08  7:11 [PATCH] nvmet-tcp: do not continue for invalid icreq Hannes Reinecke
2024-03-08  9:57 ` Sagi Grimberg
2024-03-08 14:42 ` Christoph Hellwig
2024-03-08 16:20 ` Keith Busch
  -- strict thread matches above, loose matches on Subject: below --
2024-01-12  7:23 hare
2024-01-15 12:54 ` Sagi Grimberg
2024-01-15 22:11 ` Chaitanya Kulkarni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.