Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4811e309 authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French
Browse files

cifs: a smb2_validate_and_copy_iov failure does not mean the handle is invalid.



It only means that we do not have a valid cached value for the
file_all_info structure.

CC: Stable <stable@vger.kernel.org>
Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
parent ca567eb2
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -733,13 +733,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid)
	qi_rsp = (struct smb2_query_info_rsp *)rsp_iov[1].iov_base;
	qi_rsp = (struct smb2_query_info_rsp *)rsp_iov[1].iov_base;
	if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info))
	if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info))
		goto oshr_exit;
		goto oshr_exit;
	rc = smb2_validate_and_copy_iov(
	if (!smb2_validate_and_copy_iov(
				le16_to_cpu(qi_rsp->OutputBufferOffset),
				le16_to_cpu(qi_rsp->OutputBufferOffset),
				sizeof(struct smb2_file_all_info),
				sizeof(struct smb2_file_all_info),
				&rsp_iov[1], sizeof(struct smb2_file_all_info),
				&rsp_iov[1], sizeof(struct smb2_file_all_info),
				(char *)&tcon->crfid.file_all_info);
				(char *)&tcon->crfid.file_all_info))
	if (rc)
		goto oshr_exit;
		tcon->crfid.file_all_info_is_valid = 1;
		tcon->crfid.file_all_info_is_valid = 1;


 oshr_exit:
 oshr_exit: