[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7ae1b5f-255a-40cb-96da-6f8495d4b7b3@kylinos.cn>
Date: Mon, 17 Nov 2025 09:04:48 +0800
From: ChenXiaoSong <chenxiaosong@...inos.cn>
To: Namjae Jeon <linkinjeon@...nel.org>, chenxiaosong.chenxiaosong@...ux.dev
Cc: sfrench@...ba.org, smfrench@...il.com, linkinjeon@...ba.org,
christophe.jaillet@...adoo.fr, linux-cifs@...r.kernel.org,
linux-kernel@...r.kernel.org, chenxiaosong@...nxiaosong.com
Subject: Re: [PATCH v8 1/1] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to
common/fscc.h
Hi Namjae,
I have confirmed that when FileSystemName uses flexible array member,
fsAttrInfo in struct cifs_tcon does not include FileSystemName.
The following part in the CIFSSMBQFSAttributeInfo() function is correct,
we cannot add MAX_FS_NAME_LEN to sizeof(FILE_SYSTEM_ATTRIBUTE_INFO).
```c
CIFSSMBQFSAttributeInfo()
{
...
memcpy(&tcon->fsAttrInfo, response_data,
sizeof(FILE_SYSTEM_ATTRIBUTE_INFO)); // it's correct here
...
}
```
And in the following part of the SMB2_QFS_attr() function, we should
change it to `memcpy(..., min_t(..., min_len))`.
```c
SMB2_QFS_attr()
{
...
if (level == FS_ATTRIBUTE_INFORMATION)
memcpy(&tcon->fsAttrInfo, offset
+ (char *)rsp, min_t(unsigned int,
rsp_len, max_len)); // should use `min_len` here
...
}
```
Thanks,
ChenXiaoSong.
On 11/17/25 07:00, Namjae Jeon wrote:
> On Sun, Nov 16, 2025 at 3:53 PM <chenxiaosong.chenxiaosong@...ux.dev> wrote:
>>
>> From: ChenXiaoSong <chenxiaosong@...inos.cn>
>>
>> Modify the following places:
>>
>> - struct filesystem_attribute_info -> FILE_SYSTEM_ATTRIBUTE_INFO
>> - Remove MIN_FS_ATTR_INFO_SIZE definition
>> - Introduce MAX_FS_NAME_LEN
>> - max_len of FileFsAttributeInformation -> sizeof(FILE_SYSTEM_ATTRIBUTE_INFO) + MAX_FS_NAME_LEN
>> - min_len of FileFsAttributeInformation -> sizeof(FILE_SYSTEM_ATTRIBUTE_INFO)
>>
>> Then move FILE_SYSTEM_ATTRIBUTE_INFO to common header file.
>>
>> Suggested-by: Namjae Jeon <linkinjeon@...nel.org>
>> Signed-off-by: ChenXiaoSong <chenxiaosong@...inos.cn>
>
> Did you check if it is being used here too?
> cifssmb.c:4866: sizeof(FILE_SYSTEM_ATTRIBUTE_INFO));
Powered by blists - more mailing lists