Loading
nvmet-tcp: Fix the H2C expected PDU len calculation
stable inclusion from stable-v5.10.214 commit 0de2e62067d2a6733a5b8ca24066d9bbdfefaf47 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I93ED1 CVE: CVE-2023-52454 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=0de2e62067d2a6733a5b8ca24066d9bbdfefaf47 -------------------------------- [ Upstream commit 9a1abc24850eb759e36a2f8869161c3b7254c904 ] The nvmet_tcp_handle_h2c_data_pdu() function should take into consideration the possibility that the header digest and/or the data digests are enabled when calculating the expected PDU length, before comparing it to the value stored in cmd->pdu_len. Fixes: efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length") Signed-off-by:Maurizio Lombardi <mlombard@redhat.com> Reviewed-by:
Sagi Grimberg <sagi@grimberg.me> Signed-off-by:
Keith Busch <kbusch@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Wenyu Huang <huangwenyu5@huawei.com>