]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()
authorStefan Metzmacher <metze@samba.org>
Wed, 21 Aug 2024 15:18:23 +0000 (17:18 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 25 Aug 2024 14:06:25 +0000 (09:06 -0500)
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>
fs/smb/client/smb2pdu.c

index 83facb54276a317b27333200dab66e26d16189fa..8901de199a6b5cf4628ee4d19d83ecc62ef89302 100644 (file)
@@ -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;