aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-02-22 17:32:00 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2025-02-22 17:32:00 -0800
commit27102b38b8ca7ffb1622f27bcb41475d121fb67f (patch)
tree1a205c78b081127bd98a39bec534e13ced55c2ec
parentMerge tag 'x86-urgent-2025-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
parentsmb: client: Add check for next_buffer in receive_encrypted_standard() (diff)
downloadwireguard-linux-27102b38b8ca7ffb1622f27bcb41475d121fb67f.tar.xz
wireguard-linux-27102b38b8ca7ffb1622f27bcb41475d121fb67f.zip
Merge tag 'v6.14-rc3-smb3-client-fix-part2' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fix from Steve French: - Fix potential null pointer dereference * tag 'v6.14-rc3-smb3-client-fix-part2' of git://git.samba.org/sfrench/cifs-2.6: smb: client: Add check for next_buffer in receive_encrypted_standard()
-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);
}