summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorAmit Engel <amit.engel@dell.com>2021-10-27 09:49:27 +0300
committerChristoph Hellwig <hch@lst.de>2021-10-27 10:20:50 +0300
commit86aeda32b887cdaeb0f4b7bfc9971e36377181c7 (patch)
tree5920c61889ab58caf3c3e2a18546b87657fd6a21 /drivers/nvme
parente790de54e94a7a15fb725b34724d41d41cbaa60c (diff)
downloadlinux-86aeda32b887cdaeb0f4b7bfc9971e36377181c7.tar.xz
nvmet-tcp: fix header digest verification
Pass the correct length to nvmet_tcp_verify_hdgst, which is the pdu header length. This fixes a wrong behaviour where header digest verification passes although the digest is wrong. Signed-off-by: Amit Engel <amit.engel@dell.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index 586ca20837e7..46c3b3be7e03 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -1096,7 +1096,7 @@ recv:
}
if (queue->hdr_digest &&
- nvmet_tcp_verify_hdgst(queue, &queue->pdu, queue->offset)) {
+ nvmet_tcp_verify_hdgst(queue, &queue->pdu, hdr->hlen)) {
nvmet_tcp_fatal_error(queue); /* fatal */
return -EPROTO;
}