[PATCH] nvmet_tcp: fix header digest verification

Engel, Amit Amit.Engel at Dell.com
Mon Oct 25 01:47:14 PDT 2021


In nvmet_tcp_try_recv_pdu:
1. After kernel_recvmsg, 'queue->offset' is equal to 'sizeof(struct nvme_tcp_hdr)'

2. update queue->left = hdr->hlen - queue->offset + hdgst and 'goto recv'

3. after recvmsg , the offset is greater than the digest.

So , In this case offset != hdr->hlen 

This will lead to nvmet_tcp_verify_hdgst to always pass, which 

Thanks
Amit


Internal Use - Confidential

-----Original Message-----
From: Sagi Grimberg <sagi at grimberg.me> 
Sent: Wednesday, October 20, 2021 8:53 PM
To: Engel, Amit; linux-nvme at lists.infradead.org; hch at lst.de
Subject: Re: [PATCH] nvmet_tcp: fix header digest verification


[EXTERNAL EMAIL] 


> One of our tests found that
> With the current code,
> recv_digest == exp_digest even if the pdu header digest is being 
> modified (synthetically) For example:
> In case that pdu header digest is changed to 0xffffffff, recv == exp 
> == 0xfffffff, and nvmet_tcp_verify_hdgst returns 0 - which is wrong

Not sure I follow. Can you describe in which case the passed offset !=
hdr->hlen?


> Internal Use - Confidential

Is this confidential?


More information about the Linux-nvme mailing list