Re: [PATCH] ksmbd: limit read/write/trans buffer size not to exceed 8MB

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

 



On Fri, Oct 8, 2021 at 7:31 AM Namjae Jeon <linkinjeon@xxxxxxxxxx> wrote:
>
> ksmbd limit read/write/trans buffer size not to exceed 8MB like samba.
>

[..]

> @@ -284,6 +284,7 @@ int init_smb3_11_server(struct ksmbd_conn *conn)
>
>  void init_smb2_max_read_size(unsigned int sz)
>  {
> +       sz = min_t(u32, sz, SMB_MAX_IOSIZE);
>         smb21_server_values.max_read_size = sz;
>         smb30_server_values.max_read_size = sz;
>         smb302_server_values.max_read_size = sz;
> @@ -292,6 +293,7 @@ void init_smb2_max_read_size(unsigned int sz)
>
>  void init_smb2_max_write_size(unsigned int sz)
>  {
> +       sz = min_t(u32, sz, SMB_MAX_IOSIZE);
>         smb21_server_values.max_write_size = sz;
>         smb30_server_values.max_write_size = sz;
>         smb302_server_values.max_write_size = sz;
> @@ -300,6 +302,7 @@ void init_smb2_max_write_size(unsigned int sz)
>
>  void init_smb2_max_trans_size(unsigned int sz)
>  {
> +       sz = min_t(u32, sz, SMB_MAX_IOSIZE);
>         smb21_server_values.max_trans_size = sz;
>         smb30_server_values.max_trans_size = sz;
>         smb302_server_values.max_trans_size = sz;

Does SMB2 support max request size of 8MB or does it support requests
of only up to 64k in size?



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

  Powered by Linux