diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2021-07-21 10:03:19 +0900 |
---|---|---|
committer | Namjae Jeon <namjae.jeon@samsung.com> | 2021-07-22 09:56:00 +0900 |
commit | af320a739029f6f8c5c05e769fadaf88e9b7d34f (patch) | |
tree | bbc75384d94f3beca06698a40e00be2900a2825b /fs/ksmbd/smb2pdu.h | |
parent | 9223958816f9df133ae936c9371378ba1203e0da (diff) |
ksmbd: add negotiate context verification
This patch add negotiate context verification code to check bounds.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/smb2pdu.h')
-rw-r--r-- | fs/ksmbd/smb2pdu.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ksmbd/smb2pdu.h b/fs/ksmbd/smb2pdu.h index 0eac40e1ba65..21cb93e771f7 100644 --- a/fs/ksmbd/smb2pdu.h +++ b/fs/ksmbd/smb2pdu.h @@ -299,7 +299,7 @@ struct smb2_encryption_neg_context { __le32 Reserved; /* CipherCount usally 2, but can be 3 when AES256-GCM enabled */ __le16 CipherCount; /* AES-128-GCM and AES-128-CCM by default */ - __le16 Ciphers[1]; + __le16 Ciphers[]; } __packed; #define SMB3_COMPRESS_NONE cpu_to_le16(0x0000) @@ -314,7 +314,7 @@ struct smb2_compression_ctx { __le16 CompressionAlgorithmCount; __u16 Padding; __le32 Reserved1; - __le16 CompressionAlgorithms[1]; + __le16 CompressionAlgorithms[]; } __packed; #define POSIX_CTXT_DATA_LEN 16 @@ -329,7 +329,7 @@ struct smb2_netname_neg_context { __le16 ContextType; /* 0x100 */ __le16 DataLength; __le32 Reserved; - __le16 NetName[0]; /* hostname of target converted to UCS-2 */ + __le16 NetName[]; /* hostname of target converted to UCS-2 */ } __packed; struct smb2_negotiate_rsp { |