summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhangGuoDong <zhangguodong@kylinos.cn>2026-03-03 15:13:11 +0000
committerSasha Levin <sashal@kernel.org>2026-03-12 07:09:56 -0400
commitb751369b03c8a386bc73a4b94bb8c0210fc0682b (patch)
tree3c891ab4b8d0a1de7ea6f8ba7dd74919f2bba432
parent3eeddb80191f7626ec1ef742bfff51ec3b0fa5c2 (diff)
downloadlinux-b751369b03c8a386bc73a4b94bb8c0210fc0682b.tar.gz
linux-b751369b03c8a386bc73a4b94bb8c0210fc0682b.tar.bz2
linux-b751369b03c8a386bc73a4b94bb8c0210fc0682b.zip
smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op()
[ Upstream commit 12c43a062acb0ac137fc2a4a106d4d084b8c5416 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/smb/client/smb2inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index 5c25f25aa2ef..a5f9f73ac91b 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -322,7 +322,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 {
@@ -332,7 +332,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);
}