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

Ralph Boehme
2021-10-05T07:46:40Z

[-- Attachment #1.1: Type: text/plain, Size: 702 bytes --]

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);

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]