Re: [PATCH 3/3] cifs: limit amount of data we request for xattrs to CIFSMaxBufSize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



чт, 24 янв. 2019 г. в 17:02, Ronnie Sahlberg <lsahlber@xxxxxxxxxx>:
>
> minus the various headers and blobs that will be part of the reply.
>
> or else we might trigger a session reconnect.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
> ---
>  fs/cifs/smb2ops.c |  6 +++++-
>  fs/cifs/smb2pdu.h | 14 ++++++++++++--
>  2 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
> index 34f621fe6dc0..66ae218714bd 100644
> --- a/fs/cifs/smb2ops.c
> +++ b/fs/cifs/smb2ops.c
> @@ -905,7 +905,11 @@ smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon,
>                                       FILE_READ_EA,
>                                       FILE_FULL_EA_INFORMATION,
>                                       SMB2_O_INFO_FILE,
> -                                     SMB2_MAX_EA_BUF,
> +                                     CIFSMaxBufSize - 4 -
> +                                     SMB2_TRANSFORM_HEADER_SIZE -
> +                                     MAX_SMB2_CREATE_RESPONSE_SIZE -
> +                                     72 - /* query info response */
> +                                     MAX_SMB2_CLOSE_RESPONSE_SIZE,
>                                       &rsp_iov, &buftype, cifs_sb);

The bigbuffer is

>  /* 4 len + 52 transform hdr + 64 hdr + 88 create rsp */

plus

CIFSMaxBufSize.

The 1st part (in /* */) can have 4 + SMB2_TRANSFORM_HEADER_SIZE  + 72
(query response). The 2nd (CIFSMaxBufSize) is for
MAX_SMB2_CREATE_RESPONSE_SIZE, MAX_SMB2_CLOSE_RESPONSE_SIZE + query
resp output payload. It seems that output_len argument should be:

output_len = CIFSMaxBufSize - MAX_SMB2_CREATE_RESPONSE_SIZE -
MAX_SMB2_CLOSE_RESPONSE_SIZE.

Correct?

--
Best regards,
Pavel Shilovsky




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux