diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2021-09-24 02:17:30 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-10-06 07:23:00 +0200 |
commit | 363999901116ffa9a5462215fef25ea9c7f2823c (patch) | |
tree | 455be8212ffe20e9c6b7cac6de637e091feced15 /fs/ksmbd/smb_common.h | |
parent | Linux 5.15-rc4 (diff) | |
download | linux-363999901116ffa9a5462215fef25ea9c7f2823c.tar.xz linux-363999901116ffa9a5462215fef25ea9c7f2823c.zip |
ksmbd: add the check to vaildate if stream protocol length exceeds maximum value
This patch add MAX_STREAM_PROT_LEN macro and check if stream protocol
length exceeds maximum value. opencode pdu size check in
ksmbd_pdu_size_has_room().
Cc: Tom Talpey <tom@talpey.com>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Ralph Böhme <slow@samba.org>
Acked-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/smb_common.h')
-rw-r--r-- | fs/ksmbd/smb_common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ksmbd/smb_common.h b/fs/ksmbd/smb_common.h index 994abede27e9..6e79e7577f6b 100644 --- a/fs/ksmbd/smb_common.h +++ b/fs/ksmbd/smb_common.h @@ -48,6 +48,8 @@ #define CIFS_DEFAULT_IOSIZE (64 * 1024) #define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */ +#define MAX_STREAM_PROT_LEN 0x00FFFFFF + /* Responses when opening a file. */ #define F_SUPERSEDED 0 #define F_OPENED 1 @@ -493,8 +495,6 @@ int ksmbd_lookup_dialect_by_id(__le16 *cli_dialects, __le16 dialects_count); int ksmbd_init_smb_server(struct ksmbd_work *work); -bool ksmbd_pdu_size_has_room(unsigned int pdu); - struct ksmbd_kstat; int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, |