]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op()
authorZhangGuoDong <zhangguodong@kylinos.cn>
Tue, 3 Mar 2026 15:13:11 +0000 (15:13 +0000)
committerSteve French <stfrench@microsoft.com>
Wed, 4 Mar 2026 00:03:56 +0000 (18:03 -0600)
Use `sizeof(struct smb311_posix_qinfo)` instead of sizeof its pointer,
so the allocated buffer matches the actual struct size.

Fixes: 6a5f6592a0b6 ("SMB311: Add support for query info using posix extensions (level 100)")
Reported-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2inode.c

index 195a38fd61e85d85b5146c8243083a3bb434b565..1c4663ed7e69b6e0c463605d9e46a5ec97d5193e 100644 (file)
@@ -325,7 +325,7 @@ replay_again:
                                                          cfile->fid.volatile_fid,
                                                          SMB_FIND_FILE_POSIX_INFO,
                                                          SMB2_O_INFO_FILE, 0,
-                                                         sizeof(struct smb311_posix_qinfo *) +
+                                                         sizeof(struct smb311_posix_qinfo) +
                                                          (PATH_MAX * 2) +
                                                          (sizeof(struct smb_sid) * 2), 0, NULL);
                        } else {
@@ -335,7 +335,7 @@ replay_again:
                                                          COMPOUND_FID,
                                                          SMB_FIND_FILE_POSIX_INFO,
                                                          SMB2_O_INFO_FILE, 0,
-                                                         sizeof(struct smb311_posix_qinfo *) +
+                                                         sizeof(struct smb311_posix_qinfo) +
                                                          (PATH_MAX * 2) +
                                                          (sizeof(struct smb_sid) * 2), 0, NULL);
                        }