* [PATCH][SMB3] correct definitions for app instance open contexts
@ 2023-05-01 3:26 Steve French
2023-05-02 5:56 ` Namjae Jeon
0 siblings, 1 reply; 2+ messages in thread
From: Steve French @ 2023-05-01 3:26 UTC (permalink / raw)
To: CIFS, Namjae Jeon; +Cc: samba-technical
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
The name length was wrong for the structs:
SMB2_CREATE_APP_INSTANCE_ID
SMB2_CREATE_APP_INSTANCE_VERSION
See attached. Also moves these definitions to common code (fs/smbfs_common)
--
Thanks,
Steve
[-- Attachment #2: 0001-SMB3.1.1-correct-definition-for-app_instance_id-crea.patch --]
[-- Type: text/x-patch, Size: 2142 bytes --]
From 5f6ec40bb9c8b1f740818898102ed624abf6b856 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Sun, 30 Apr 2023 12:27:49 -0500
Subject: [PATCH] SMB3.1.1: correct definition for app_instance_id create
contexts
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.
Signed-off-by: Steve French <stfrench@microsoft.com>
---
fs/ksmbd/smb2pdu.h | 16 ----------------
fs/smbfs_common/smb2pdu.h | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/fs/ksmbd/smb2pdu.h b/fs/ksmbd/smb2pdu.h
index 67dc552f2ef7..aca9cfc73caa 100644
--- a/fs/ksmbd/smb2pdu.h
+++ b/fs/ksmbd/smb2pdu.h
@@ -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];
diff --git a/fs/smbfs_common/smb2pdu.h b/fs/smbfs_common/smb2pdu.h
index 3b43a51e6f7e..bae590eec871 100644
--- a/fs/smbfs_common/smb2pdu.h
+++ b/fs/smbfs_common/smb2pdu.h
@@ -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;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][SMB3] correct definitions for app instance open contexts
2023-05-01 3:26 [PATCH][SMB3] correct definitions for app instance open contexts Steve French
@ 2023-05-02 5:56 ` Namjae Jeon
0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2023-05-02 5:56 UTC (permalink / raw)
To: Steve French; +Cc: CIFS, samba-technical
2023-05-01 12:26 GMT+09:00, Steve French <smfrench@gmail.com>:
> The name length was wrong for the structs:
>
> SMB2_CREATE_APP_INSTANCE_ID
> SMB2_CREATE_APP_INSTANCE_VERSION
>
> See attached. Also moves these definitions to common code
> (fs/smbfs_common)
Looks good to me!
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Thanks!
>
> --
> Thanks,
>
> Steve
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-02 5:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-01 3:26 [PATCH][SMB3] correct definitions for app instance open contexts Steve French
2023-05-02 5:56 ` Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).