mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
ksmbd: validate compound response buffer
Add the check to validate compound response buffer. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
9a63b999ae
commit
dbad63001e
@ -449,6 +449,12 @@ bool is_chained_smb2_message(struct ksmbd_work *work)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((u64)get_rfc1002_len(work->response_buf) + MAX_CIFS_SMALL_BUFFER_SIZE >
|
||||
work->response_sz) {
|
||||
pr_err("next response offset exceeds response buffer size\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
ksmbd_debug(SMB, "got SMB2 chained command\n");
|
||||
init_chained_smb2_rsp(work);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user