Commit 731b82bb authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French

cifs: set correct max-buffer-size for smb2_ioctl_init()

Fix two places where we need to adjust down the max response size for
ioctl when it is used together with compounding.
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>
CC: Stable <stable@vger.kernel.org>
parent 37478608
...@@ -1523,7 +1523,9 @@ smb2_ioctl_query_info(const unsigned int xid, ...@@ -1523,7 +1523,9 @@ smb2_ioctl_query_info(const unsigned int xid,
COMPOUND_FID, COMPOUND_FID, COMPOUND_FID, COMPOUND_FID,
qi.info_type, true, buffer, qi.info_type, true, buffer,
qi.output_buffer_length, qi.output_buffer_length,
CIFSMaxBufSize); CIFSMaxBufSize -
MAX_SMB2_CREATE_RESPONSE_SIZE -
MAX_SMB2_CLOSE_RESPONSE_SIZE);
} }
} else if (qi.flags == PASSTHRU_SET_INFO) { } else if (qi.flags == PASSTHRU_SET_INFO) {
/* Can eventually relax perm check since server enforces too */ /* Can eventually relax perm check since server enforces too */
...@@ -2769,7 +2771,10 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, ...@@ -2769,7 +2771,10 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
rc = SMB2_ioctl_init(tcon, &rqst[1], fid.persistent_fid, rc = SMB2_ioctl_init(tcon, &rqst[1], fid.persistent_fid,
fid.volatile_fid, FSCTL_GET_REPARSE_POINT, fid.volatile_fid, FSCTL_GET_REPARSE_POINT,
true /* is_fctl */, NULL, 0, CIFSMaxBufSize); true /* is_fctl */, NULL, 0,
CIFSMaxBufSize -
MAX_SMB2_CREATE_RESPONSE_SIZE -
MAX_SMB2_CLOSE_RESPONSE_SIZE);
if (rc) if (rc)
goto querty_exit; goto querty_exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment