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>
This commit is contained in:
parent
f58eae6c5f
commit
6d56262c3d
@ -4045,6 +4045,10 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp,
|
||||
path = &fp->filp->f_path;
|
||||
/* single EA entry is requested with given user.* name */
|
||||
if (req->InputBufferLength) {
|
||||
if (le32_to_cpu(req->InputBufferLength) <
|
||||
sizeof(struct smb2_ea_info_req))
|
||||
return -EINVAL;
|
||||
|
||||
ea_req = (struct smb2_ea_info_req *)req->Buffer;
|
||||
} else {
|
||||
/* need to send all EAs, if no specific EA is requested*/
|
||||
|
Loading…
Reference in New Issue
Block a user