All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: Ralph Boehme <slow@samba.org>
Cc: linux-cifs@vger.kernel.org, Tom Talpey <tom@talpey.com>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Steve French <smfrench@gmail.com>,
	Hyunchul Lee <hyc.lee@gmail.com>
Subject: Re: [PATCH v7 3/9] ksmbd: add and use ksmbd_smb2_cur_pdu_buflen() in ksmbd_smb2_check_message()
Date: Thu, 7 Oct 2021 08:42:36 +0900	[thread overview]
Message-ID: <CAKYAXd_n9cBO6+ND9axR8qFtEpfL9qvq+Zyon1PiLbZ0=AOPWQ@mail.gmail.com> (raw)
In-Reply-To: <2565d01b-0145-fe8b-1ce4-9c8f2e658b62@samba.org>

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
>

  reply	other threads:[~2021-10-06 23:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  5:03 [PATCH v7 0/9] Buffer validation and compound handling patches Ralph Boehme
2021-10-05  5:03 ` [PATCH v7 1/9] ksmbd: use ksmbd_req_buf_next() in ksmbd_verify_smb_message() Ralph Boehme
2021-10-05  7:26   ` Namjae Jeon
2021-10-05  5:03 ` [PATCH v7 2/9] ksmbd: use ksmbd_req_buf_next() in ksmbd_smb2_check_message() Ralph Boehme
2021-10-05  7:27   ` Namjae Jeon
2021-10-05  5:03 ` [PATCH v7 3/9] ksmbd: add and use ksmbd_smb2_cur_pdu_buflen() " Ralph Boehme
2021-10-05  7:29   ` Namjae Jeon
2021-10-05  7:46     ` Ralph Boehme
2021-10-06 23:42       ` Namjae Jeon [this message]
2021-10-05  5:03 ` [PATCH v7 4/9] ksmbd: check buffer is big enough to access the SMB2 PUD body size field Ralph Boehme
2021-10-05  5:03 ` [PATCH v7 5/9] ksmdb: validate credit charge after validating SMB2 PDU body size Ralph Boehme
2021-10-05  7:58   ` Namjae Jeon
2021-10-05  5:03 ` [PATCH v7 6/9] ksmdb: use cmd helper variable in smb2_get_ksmbd_tcon() Ralph Boehme
2021-10-05  7:59   ` Namjae Jeon
2021-10-05  5:03 ` [PATCH v7 7/9] ksmdb: make smb2_get_ksmbd_tcon() callable with chained PDUs Ralph Boehme
2021-10-05  5:03 ` [PATCH v7 8/9] ksmbd: make smb2_check_user_session() callable for compound PDUs Ralph Boehme
2021-10-05  5:03 ` [PATCH v7 9/9] ksmdb: move session and tcon validation to __process_request() Ralph Boehme

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKYAXd_n9cBO6+ND9axR8qFtEpfL9qvq+Zyon1PiLbZ0=AOPWQ@mail.gmail.com' \
    --to=linkinjeon@kernel.org \
    --cc=hyc.lee@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=slow@samba.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.