Skip to content

Commit 3a17df1

Browse files
committed
smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()
JIRA: https://issues.redhat.com/browse/RHEL-57983 commit c724b2a Author: Stefan Metzmacher <metze@samba.org> Date: Wed Aug 21 17:18:23 2024 +0200 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: a6559cc ("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> Signed-off-by: Paulo Alcantara <paalcant@redhat.com>
1 parent 301b472 commit 3a17df1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4437,7 +4437,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
44374437
* If we want to do a RDMA write, fill in and append
44384438
* smbd_buffer_descriptor_v1 to the end of read request
44394439
*/
4440-
if (smb3_use_rdma_offload(io_parms)) {
4440+
if (rdata && smb3_use_rdma_offload(io_parms)) {
44414441
struct smbd_buffer_descriptor_v1 *v1;
44424442
bool need_invalidate = server->dialect == SMB30_PROT_ID;
44434443

0 commit comments

Comments
 (0)