Skip to content

Commit

Permalink
SMB3.1.1: correct definition for app_instance_id create contexts
Browse files Browse the repository at this point in the history
The name lengths were incorrect for two create contexts.
     SMB2_CREATE_APP_INSTANCE_ID
     SMB2_CREATE_APP_INSTANCE_VERSION

Update the definitions for these two to match the protocol specs.

Acked-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Steve French committed May 2, 2023
1 parent 26c009d commit 3d6b15a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
16 changes: 0 additions & 16 deletions fs/ksmbd/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,6 @@ struct create_durable_reconn_v2_req {
__le32 Flags;
} __packed;

struct create_app_inst_id {
struct create_context ccontext;
__u8 Name[8];
__u8 Reserved[8];
__u8 AppInstanceId[16];
} __packed;

struct create_app_inst_id_vers {
struct create_context ccontext;
__u8 Name[8];
__u8 Reserved[2];
__u8 Padding[4];
__le64 AppInstanceVersionHigh;
__le64 AppInstanceVersionLow;
} __packed;

struct create_alloc_size_req {
struct create_context ccontext;
__u8 Name[8];
Expand Down
20 changes: 20 additions & 0 deletions fs/smbfs_common/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,26 @@ struct create_disk_id_rsp {
__u8 Reserved[16];
} __packed;

/* See MS-SMB2 2.2.13.2.13 */
struct create_app_inst_id {
struct create_context ccontext;
__u8 Name[16];
__le32 StructureSize; /* Must be 20 */
__u16 Reserved;
__u8 AppInstanceId[16];
} __packed;

/* See MS-SMB2 2.2.13.2.15 */
struct create_app_inst_id_vers {
struct create_context ccontext;
__u8 Name[16];
__le32 StructureSize; /* Must be 24 */
__u16 Reserved;
__u32 Padding;
__le64 AppInstanceVersionHigh;
__le64 AppInstanceVersionLow;
} __packed;

/* See MS-SMB2 2.2.31 and 2.2.32 */
struct smb2_ioctl_req {
struct smb2_hdr hdr;
Expand Down

0 comments on commit 3d6b15a

Please sign in to comment.