Skip to content

Commit e7b8b8e

Browse files
Gustav JohanssonSteve French
authored andcommitted
ksmbd: smb2: Allow messages padded to 8byte boundary
clc length is now accepted to <= 8 less than length, rather than < 8. Solve issues on some of Axis's smb clients which send messages where clc length is 8 bytes less than length. The specific client was running kernel 4.19.217 with smb dialect 3.0.2 on armv7l. Cc: stable@vger.kernel.org Signed-off-by: Gustav Johansson <gustajo@axis.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 443d61d commit e7b8b8e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/ksmbd/smb2misc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,11 @@ int ksmbd_smb2_check_message(struct ksmbd_work *work)
416416

417417
/*
418418
* Allow a message that padded to 8byte boundary.
419+
* Linux 4.19.217 with smb 3.0.2 are sometimes
420+
* sending messages where the cls_len is exactly
421+
* 8 bytes less than len.
419422
*/
420-
if (clc_len < len && (len - clc_len) < 8)
423+
if (clc_len < len && (len - clc_len) <= 8)
421424
goto validate_credit;
422425

423426
pr_err_ratelimited(

0 commit comments

Comments
 (0)