mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
ksmbd: move credit charge verification over smb2 request size verification
Move credit charge verification over smb2 request size verification to avoid being skipped. Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
67307023d0
commit
d347d745f0
@ -385,6 +385,12 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)
|
||||
}
|
||||
}
|
||||
|
||||
if ((work->conn->vals->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU) &&
|
||||
smb2_validate_credit_charge(hdr)) {
|
||||
work->conn->ops->set_rsp_status(work, STATUS_INVALID_PARAMETER);
|
||||
return 1;
|
||||
}
|
||||
|
||||
clc_len = smb2_calc_size(hdr);
|
||||
if (len != clc_len) {
|
||||
/* server can return one byte more due to implied bcc[0] */
|
||||
@ -423,12 +429,6 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((work->conn->vals->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU) &&
|
||||
smb2_validate_credit_charge(hdr)) {
|
||||
work->conn->ops->set_rsp_status(work, STATUS_INVALID_PARAMETER);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user