All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: dhowells@redhat.com, sfrench@samba.org, smfrench@gmail.com,
	linkinjeon@samba.org, pc@manguebit.org, ronniesahlberg@gmail.com,
	sprasad@microsoft.com, tom@talpey.com, bharathsm@microsoft.com,
	senozhatsky@chromium.org, linux-cifs@vger.kernel.org,
	ChenXiaoSong <chenxiaosong@kylinos.cn>
Subject: Re: [PATCH] smb/server: fix SMB2_MIN_SUPPORTED_HEADER_SIZE value
Date: Fri, 19 Dec 2025 09:45:54 +0800	[thread overview]
Message-ID: <2e403314-e32e-4f48-bbf3-e014a0143095@linux.dev> (raw)
In-Reply-To: <CAKYAXd-J2-t2315ibQX6GvvQx6Wqd-Y=tOc=if3eFANWBEggXQ@mail.gmail.com>

I will analyze the code in more detail. Thanks for your review.

Thanks,
ChenXiaoSong.

On 12/19/25 09:42, Namjae Jeon wrote:
> On Fri, Dec 19, 2025 at 10:31 AM ChenXiaoSong
> <chenxiaosong.chenxiaosong@linux.dev> wrote:
>>
>> Hi Namjae,
>>
>> `SMB1_MIN_SUPPORTED_HEADER_SIZE` and `SMB2_MIN_SUPPORTED_HEADER_SIZE`
>> are only used in `ksmbd_conn_handler_loop()` to check the PDU size, and
>> seems not to cause slab-out-of-bounds issues.
> Okay, I explained it but you didn't listen... So I can not ACK this patch.
>>
>> Thanks,
>> ChenXiaoSong.
>>
>> On 12/19/25 09:16, Namjae Jeon wrote:
>>> On Fri, Dec 19, 2025 at 10:00 AM ChenXiaoSong
>>> <chenxiaosong.chenxiaosong@linux.dev> wrote:
>>>>
>>>> Hi Namjae,
>>>>
>>>> We should rename them to `SMB1_MIN_SUPPORTED_PDU_SIZE` and
>>>> `SMB2_MIN_SUPPORTED_PDU_SIZE`.
>>>>
>>>> But we "should not" add "+4" to them.
>>> Not adding the +4 will trigger a slab-out-of-bounds issue.
>>> You should check ksmbd_smb2_check_message() and
>>> ksmbd_negotiate_smb_dialect() as well as ksmbd_conn_handler_loop().
>>>>
>>>> The `ksmbd_conn_handler_loop()` function is as follows:
>>>>
>>>> ksmbd_conn_handler_loop()
>>>> {
>>>>      ...
>>>>      pdu_size = get_rfc1002_len(hdr_buf);
>>>>      ...
>>>>      if (pdu_size < SMB1_MIN_SUPPORTED_HEADER_SIZE)
>>>>      ...
>>>>      if (pdu_size < SMB2_MIN_SUPPORTED_HEADER_SIZE)
>>>>      ...
>>>> }
>>>>
>>>> Thanks,
>>>> ChenXiaoSong.
>>>>


  reply	other threads:[~2025-12-19  1:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 17:10 [PATCH] smb/server: fix SMB2_MIN_SUPPORTED_HEADER_SIZE value chenxiaosong.chenxiaosong
2025-12-19  0:16 ` Namjae Jeon
2025-12-19  0:59   ` ChenXiaoSong
2025-12-19  1:16     ` Namjae Jeon
2025-12-19  1:30       ` ChenXiaoSong
2025-12-19  1:42         ` Namjae Jeon
2025-12-19  1:45           ` ChenXiaoSong [this message]
2025-12-19  8:17       ` David Howells
2025-12-19 10:32         ` Namjae Jeon
2025-12-19 10:42           ` ChenXiaoSong
2025-12-19 10:50           ` David Howells
2025-12-19 11:52             ` Namjae Jeon
2025-12-19 13:53               ` ChenXiaoSong

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=2e403314-e32e-4f48-bbf3-e014a0143095@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=bharathsm@microsoft.com \
    --cc=chenxiaosong@kylinos.cn \
    --cc=dhowells@redhat.com \
    --cc=linkinjeon@kernel.org \
    --cc=linkinjeon@samba.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.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.