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]

 



2021-10-12 10:01 GMT+09:00, Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>:
> 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?
I have sent v3 patch to the list now. Please check it.
This value should be greater than or equal to 65536 and smaller than
max rfc1002 length.

Thanks!
>



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

  Powered by Linux