ksmbd: validate the zero field of packet header
authorLi Nan <linan122@huawei.com>
Fri, 8 Dec 2023 06:56:47 +0000 (14:56 +0800)
committerSteve French <stfrench@microsoft.com>
Tue, 9 Jan 2024 18:52:32 +0000 (12:52 -0600)
commit516b3eb8c8065f7465f87608d37a7ed08298c7a5
tree8e920f651ea2a05346a7917744fa9d324c394e90
parent0dd3ee31125508cd67f7e7172247f05b7fd1753a
ksmbd: validate the zero field of packet header

The SMB2 Protocol requires that "The first byte of the Direct TCP
transport packet header MUST be zero (0x00)"[1]. Commit 1c1bcf2d3ea0
("ksmbd: validate smb request protocol id") removed the validation of
this 1-byte zero. Add the validation back now.

[1]: [MS-SMB2] - v20230227, page 30.
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SMB2/%5bMS-SMB2%5d-230227.pdf

Fixes: 1c1bcf2d3ea0 ("ksmbd: validate smb request protocol id")
Signed-off-by: Li Nan <linan122@huawei.com>
Acked-by: Tom Talpey <tom@talpey.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb_common.c