Re: [PATCH v7 3/9] ksmbd: add and use ksmbd_smb2_cur_pdu_buflen() in ksmbd_smb2_check_message()

Namjae Jeon
2021-10-06T23:42:39Z

2021-10-05 16:46 GMT+09:00, Ralph Boehme <slow@samba.org>:
> Am 05.10.21 um 09:29 schrieb Namjae Jeon:
>> 2021-10-05 14:03 GMT+09:00, Ralph Boehme <slow@samba.org>:
>>> - if (ALIGN(clc_len, 8) == len)
>>> + if (ALIGN(clc_len, 8) == ALIGN(len, 8))
>> Can I know why you align rfc1002 len with 8 here ?
>
> this should match the previous behaviour where for compound requests we
> called round_up(len, 8).
>
> This could be done differently though:
>
> len = ksmbd_smb2_cur_pdu_buflen(work);
> if (work->next_smb2_rcv_hdr_off)
> len = ALIGN(len, 8);
I think that this code is wrong, we don't need to add pad about last
compound *request* length.

Thanks!

>
> and then just do
>
> if (ALIGN(clc_len, 8) == len)
>
> -slow
>
> --
> Ralph Boehme, Samba Team https://samba.org/
> SerNet Samba Team Lead https://sernet.de/en/team-samba
>