diff options
author | Stefan Metzmacher <metze@samba.org> | 2024-08-21 17:18:23 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-08-25 16:06:25 +0200 |
commit | c724b2ab6a46435b4e7d58ad2fbbdb7a318823cf (patch) | |
tree | 229fced11ed4cc7afea73cb9ada951e11419ca35 /fs/smb/client | |
parent | Linux 6.11-rc5 (diff) | |
download | linux-c724b2ab6a46435b4e7d58ad2fbbdb7a318823cf.tar.xz linux-c724b2ab6a46435b4e7d58ad2fbbdb7a318823cf.zip |
smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()
This happens when called from SMB2_read() while using rdma
and reaching the rdma_readwrite_threshold.
Cc: stable@vger.kernel.org
Fixes: a6559cc1d35d ("cifs: split out smb3_use_rdma_offload() helper")
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client')
-rw-r--r-- | fs/smb/client/smb2pdu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c index 83facb54276a..8901de199a6b 100644 --- a/fs/smb/client/smb2pdu.c +++ b/fs/smb/client/smb2pdu.c @@ -4441,7 +4441,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len, * If we want to do a RDMA write, fill in and append * smbd_buffer_descriptor_v1 to the end of read request */ - if (smb3_use_rdma_offload(io_parms)) { + if (rdata && smb3_use_rdma_offload(io_parms)) { struct smbd_buffer_descriptor_v1 *v1; bool need_invalidate = server->dialect == SMB30_PROT_ID; |