]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmet-tcp: Fix the H2C expected PDU len calculation
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 5 Jan 2024 08:14:44 +0000 (09:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:27:48 +0000 (15:27 -0800)
commit11923a8df8edd9f85481490882a8abd50851df40
tree2ac12778b1594364018ac10788626b189bfd0641
parentfb711858e669e8780d2c454e5c29ca0fcb4dc039
nvmet-tcp: Fix the H2C expected PDU len calculation

[ 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>
drivers/nvme/target/tcp.c