Skip to content

Commit 12c43a0

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op()
Use `sizeof(struct smb311_posix_qinfo)` instead of sizeof its pointer, so the allocated buffer matches the actual struct size. Fixes: 6a5f659 ("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>
1 parent 6f04025 commit 12c43a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/smb/client/smb2inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
325325
cfile->fid.volatile_fid,
326326
SMB_FIND_FILE_POSIX_INFO,
327327
SMB2_O_INFO_FILE, 0,
328-
sizeof(struct smb311_posix_qinfo *) +
328+
sizeof(struct smb311_posix_qinfo) +
329329
(PATH_MAX * 2) +
330330
(sizeof(struct smb_sid) * 2), 0, NULL);
331331
} else {
@@ -335,7 +335,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
335335
COMPOUND_FID,
336336
SMB_FIND_FILE_POSIX_INFO,
337337
SMB2_O_INFO_FILE, 0,
338-
sizeof(struct smb311_posix_qinfo *) +
338+
sizeof(struct smb311_posix_qinfo) +
339339
(PATH_MAX * 2) +
340340
(sizeof(struct smb_sid) * 2), 0, NULL);
341341
}

0 commit comments

Comments
 (0)