From patchwork Mon May 1 03:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1775411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=p9bPFMRi; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4Q8ptF4P5hz1ydV for ; Mon, 1 May 2023 13:41:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232282AbjEADly (ORCPT ); Sun, 30 Apr 2023 23:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232924AbjEADld (ORCPT ); Sun, 30 Apr 2023 23:41:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F8DD1E702 for ; Sun, 30 Apr 2023 20:27:42 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4efec123b28so2889484e87.1 for ; Sun, 30 Apr 2023 20:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682911591; x=1685503591; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=dat2lOmwD0lAA8LhC9hc2ZhZVDwetUOJd11QGeskZD4=; b=p9bPFMRir43Yn5GaDfelYcDqWrmys4Cc2Kknwdfy7tWCDCS5bJdvJXryjYH1ebjOdG B/6rx3LeUdfwiNwULM/tZZhNmA5fAEyPKtYhgJM4TOf0RO00L9atZLB3p6hPkYtGXD8Z WobPyEZ8zrkd6bvpX0PsyWmddv/ri09a6/TDe4XCzE57AF5e8B/jXuOAtt1eqzylJWCX DNfv6gb00eaqxzjyjYUVtFzTreh3M6H461Us1dgiNNSF7F3rEyagFJ6jxVLe9dsWZG7l tgUJ/UhLIg/XwnId8+oZDflbNIZApQflY+byRO/QhZ8qR6wjyoe8g4jrVm/o+z2rKD3l r9JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682911591; x=1685503591; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dat2lOmwD0lAA8LhC9hc2ZhZVDwetUOJd11QGeskZD4=; b=Ja4VMCwwLBhmbH8R+WjfmpRbNAObhhvc18K350yiwZJevwz6ES87M3Q0++tcU8OLD/ Ocqcv/CLzGJh3i1hB76Q9Hg340IYbjW3PNY+T7nTMXq/rWvJUjeeoDQU+fgwN17Fmwkr O/XHP+mrEm12qR7jMuhOq2+Aph6tCbIT2fTuQ92UemnwAa5CjjsX92xGf3HXb/g9uTeJ jjk2JsxR/5aPHjnvS+FzPOLHaEmygrxujXQ8wxl5EyH0cUZ5P4nmOklpupD6OsCssL3X /MC27OeR0jusTfanDKp0PI6IK28IOiUO9qY4s6rCER79CFkew2krbB4q1ZMCXVzmYWUu GbXg== X-Gm-Message-State: AC+VfDzgpXH5VE4dftGiqT90wOElDlhPFzByh5aJc5dx2Q+B7pAwOrZo rgk3rvMDWsLiPzsywVq+Dwfb+qBw3mEjB3ljMLGgQUZQQDM= X-Google-Smtp-Source: ACHHUZ6/zZYFWBzB24ccEv8XtQRewo1UgX9Or26bqgM9Yf5W8N5Vcn9a1XsE+cxFwUYYSXAkwcMQg8fKoniIPnrz3Fc= X-Received: by 2002:a2e:a0d1:0:b0:2a8:ddb0:baa6 with SMTP id f17-20020a2ea0d1000000b002a8ddb0baa6mr3465905ljm.4.1682911591263; Sun, 30 Apr 2023 20:26:31 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Sun, 30 Apr 2023 22:26:19 -0500 Message-ID: Subject: [PATCH][SMB3] correct definitions for app instance open contexts To: CIFS , Namjae Jeon Cc: samba-technical X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org 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) Acked-by: Namjae Jeon From 5f6ec40bb9c8b1f740818898102ed624abf6b856 Mon Sep 17 00:00:00 2001 From: Steve French 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 --- 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