summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoxiang Li <haoxiang_li2024@163.com>2025-02-17 15:20:38 +0800
committerSteve French <stfrench@microsoft.com>2025-02-20 12:10:39 -0600
commit860ca5e50f73c2a1cef7eefc9d39d04e275417f7 (patch)
tree215088b8f37ec0065d81d85357ae5df77816a8b6
parente9a8cac0bf895efe0bc7b11d174e8dae9b195da8 (diff)
smb: client: Add check for next_buffer in receive_encrypted_standard()
Add check for the return value of cifs_buf_get() and cifs_small_buf_get() in receive_encrypted_standard() to prevent null pointer dereference. Fixes: eec04ea11969 ("smb: client: fix OOB in receive_encrypted_standard()") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/client/smb2ops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 23e0c8be7fb5..4dd11eafb69d 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -4965,6 +4965,10 @@ one_more:
next_buffer = (char *)cifs_buf_get();
else
next_buffer = (char *)cifs_small_buf_get();
+ if (!next_buffer) {
+ cifs_server_dbg(VFS, "No memory for (large) SMB response\n");
+ return -1;
+ }
memcpy(next_buffer, buf + next_cmd, pdu_length - next_cmd);
}