mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
nvmet-tcp: fix header digest verification
[ Upstream commit 86aeda32b8 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c8270435cf
commit
ad6a2a1e56
|
|
@ -1084,7 +1084,7 @@ static int nvmet_tcp_try_recv_pdu(struct nvmet_tcp_queue *queue)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queue->hdr_digest &&
|
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 */
|
nvmet_tcp_fatal_error(queue); /* fatal */
|
||||||
return -EPROTO;
|
return -EPROTO;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user