Re: [PATCH v8 1/1] smb: move FILE_SYSTEM_ATTRIBUTE_INFO to common/fscc.h

From: ChenXiaoSong
Date: Sun Nov 16 2025 - 20:07:59 EST


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:

Did you check if it is being used here too?
cifssmb.c:4866: sizeof(FILE_SYSTEM_ATTRIBUTE_INFO));