smb: client: fix OOB in receive_encrypted_standard()
authorPaulo Alcantara <pc@manguebit.com>
Mon, 11 Dec 2023 13:26:40 +0000 (10:26 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 16:02:05 +0000 (17:02 +0100)
commit534733397da26de0303057ce0b93a22bda150365
tree47ce59129d695a41b4acd7bc970cbccff712f6a4
parent4029b025bedaee1cd819f4f9a8b2244266fd320b
smb: client: fix OOB in receive_encrypted_standard()

commit eec04ea119691e65227a97ce53c0da6b9b74b0b7 upstream.

Fix potential OOB in receive_encrypted_standard() if server returned a
large shdr->NextCommand that would end up writing off the end of
@next_buffer.

Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses")
Cc: stable@vger.kernel.org
Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/smb2ops.c