smb: client: fix OOB in receive_encrypted_standard()
authorSteve French <stfrench@microsoft.com>
Sat, 27 Jan 2024 06:42:55 +0000 (00:42 -0600)
committerSteve French <stfrench@microsoft.com>
Sat, 27 Jan 2024 07:08:06 +0000 (01:08 -0600)
commitff807ef4ed4b074d1fdbdf8c2e8d7794c2c177e0
treee1ef6dc6f34593d46f13d998ce2d8d80adfb0fbe
parent0b209a4e5ef96464b0aa2bfeb89c0a252d2b358c
smb: client: fix OOB in receive_encrypted_standard()

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>
fs/cifs/smb2ops.c