diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2023-01-24 16:13:20 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-01-26 01:22:54 +0100 |
commit | 62c487b53a7ff31e322cf2874d3796b8202c54a5 (patch) | |
tree | 67667fb01beaae35df28d02a7bdb06eece15179a /fs/ksmbd/smb2pdu.h | |
parent | ksmbd: do not sign response to session request for guest login (diff) | |
download | linux-62c487b53a7ff31e322cf2874d3796b8202c54a5.tar.xz linux-62c487b53a7ff31e322cf2874d3796b8202c54a5.zip |
ksmbd: limit pdu length size according to connection status
Stream protocol length will never be larger than 16KB until session setup.
After session setup, the size of requests will not be larger than
16KB + SMB2 MAX WRITE size. This patch limits these invalidly oversized
requests and closes the connection immediately.
Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-18259
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r-- | fs/ksmbd/smb2pdu.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ksmbd/smb2pdu.h b/fs/ksmbd/smb2pdu.h index aa5dbe54f5a1..0c8a770fe318 100644 --- a/fs/ksmbd/smb2pdu.h +++ b/fs/ksmbd/smb2pdu.h @@ -24,8 +24,9 @@ #define SMB21_DEFAULT_IOSIZE (1024 * 1024) #define SMB3_DEFAULT_TRANS_SIZE (1024 * 1024) -#define SMB3_MIN_IOSIZE (64 * 1024) -#define SMB3_MAX_IOSIZE (8 * 1024 * 1024) +#define SMB3_MIN_IOSIZE (64 * 1024) +#define SMB3_MAX_IOSIZE (8 * 1024 * 1024) +#define SMB3_MAX_MSGSIZE (4 * 4096) /* * Definitions for SMB2 Protocol Data Units (network frames) |