Skip to content

Commit

Permalink
cifs: a smb2_validate_and_copy_iov failure does not mean the handle i…
Browse files Browse the repository at this point in the history
…s invalid.

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

CC: Stable <[email protected]>
Signed-off-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Steve French <[email protected]>
Reviewed-by: Pavel Shilovsky <[email protected]>
  • Loading branch information
Ronnie Sahlberg authored and Steve French committed Apr 1, 2019
1 parent ca567eb commit 4811e30
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/cifs/smb2ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,12 @@ 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;
if (le32_to_cpu(qi_rsp->OutputBufferLength) < sizeof(struct smb2_file_all_info))
goto oshr_exit;
rc = smb2_validate_and_copy_iov(
if (!smb2_validate_and_copy_iov(
le16_to_cpu(qi_rsp->OutputBufferOffset),
sizeof(struct smb2_file_all_info),
&rsp_iov[1], sizeof(struct smb2_file_all_info),
(char *)&tcon->crfid.file_all_info);
if (rc)
goto oshr_exit;
tcon->crfid.file_all_info_is_valid = 1;
(char *)&tcon->crfid.file_all_info))
tcon->crfid.file_all_info_is_valid = 1;

oshr_exit:
mutex_unlock(&tcon->crfid.fid_mutex);
Expand Down

0 comments on commit 4811e30

Please sign in to comment.