Commit b53ad810 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: don't need 8byte alignment for request length in ksmbd_check_message

When validating request length in ksmbd_check_message, 8byte alignment
is not needed for compound request. It can cause wrong validation
of request length.

Fixes: e2f34481 ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org # v5.15
Acked-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 78f1688a
......@@ -353,12 +353,10 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)
__u32 clc_len; /* calculated length */
__u32 len = get_rfc1002_len(pdu);
if (le32_to_cpu(hdr->NextCommand) > 0) {
if (le32_to_cpu(hdr->NextCommand) > 0)
len = le32_to_cpu(hdr->NextCommand);
} else if (work->next_smb2_rcv_hdr_off) {
else if (work->next_smb2_rcv_hdr_off)
len -= work->next_smb2_rcv_hdr_off;
len = round_up(len, 8);
}
if (check_smb2_hdr(hdr))
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment