Skip to content

Commit b53ad81

Browse files
namjaejeonsmfrench
authored andcommitted
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: e2f3448 ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org # v5.15 Acked-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 78f1688 commit b53ad81

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/ksmbd/smb2misc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,10 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)
353353
__u32 clc_len; /* calculated length */
354354
__u32 len = get_rfc1002_len(pdu);
355355

356-
if (le32_to_cpu(hdr->NextCommand) > 0) {
356+
if (le32_to_cpu(hdr->NextCommand) > 0)
357357
len = le32_to_cpu(hdr->NextCommand);
358-
} else if (work->next_smb2_rcv_hdr_off) {
358+
else if (work->next_smb2_rcv_hdr_off)
359359
len -= work->next_smb2_rcv_hdr_off;
360-
len = round_up(len, 8);
361-
}
362360

363361
if (check_smb2_hdr(hdr))
364362
return 1;

0 commit comments

Comments
 (0)