Skip to content

Commit 6d56262

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: add validation for FILE_FULL_EA_INFORMATION of smb2_get_info
Add validation to check whether req->InputBufferLength is smaller than smb2_ea_info_req structure size. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Steve French <smfrench@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent f58eae6 commit 6d56262

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/ksmbd/smb2pdu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,6 +4045,10 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp,
40454045
path = &fp->filp->f_path;
40464046
/* single EA entry is requested with given user.* name */
40474047
if (req->InputBufferLength) {
4048+
if (le32_to_cpu(req->InputBufferLength) <
4049+
sizeof(struct smb2_ea_info_req))
4050+
return -EINVAL;
4051+
40484052
ea_req = (struct smb2_ea_info_req *)req->Buffer;
40494053
} else {
40504054
/* need to send all EAs, if no specific EA is requested*/

0 commit comments

Comments
 (0)