From patchwork Tue Mar 17 06:59:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 11441919 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4B111874 for ; Tue, 17 Mar 2020 07:00:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B1E720719 for ; Tue, 17 Mar 2020 07:00:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="olE5qSaX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725837AbgCQHAH (ORCPT ); Tue, 17 Mar 2020 03:00:07 -0400 Received: from mail-qk1-f178.google.com ([209.85.222.178]:41520 "EHLO mail-qk1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbgCQHAG (ORCPT ); Tue, 17 Mar 2020 03:00:06 -0400 Received: by mail-qk1-f178.google.com with SMTP id s11so19452562qks.8 for ; Tue, 17 Mar 2020 00:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=YyP5/uYDqMbCadMIux2UsmVfY9d250YvoW2fEJzqdFM=; b=olE5qSaXa2r5wam1wT7beEWZlu0g4GoB25ymqdg63uHMu+oSacmuXCO6ggcH5BWwVv 4qIxkNG1E4SXYjVGOEYccDZqrhmjXJ7UucC7kU0oM50m5Y0SGdvEOohY6K3oy8LHQhlN S76hB0Xr1XZFA+NR8jxyZS8H21540wbL1zGk0TvLv9HAuP0591GJUNV2W0YWDJZ1OGho gnLRPKGgIcu+6vzpnNb6ZqfdSDa1QyYOXod7d7zVgvzTF/9przmpUJTmMWFf8UXQi2KQ 7DNtsDhaQD/MJ/3ODRimTt1mWCfoa+BVlae/x5sGhdB/tYSrz3YA7X3wtoZoLvDn+QJj qgmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=YyP5/uYDqMbCadMIux2UsmVfY9d250YvoW2fEJzqdFM=; b=L95QywW0vMvU4mUfrdvUgu7crLQSkbRv+ooZGNiNwyHrqeDOwySnyXLEp11rzubivi Ng7B/fBOgpehxdUL6NfoNMGbbP6I7vUisBd9fOj6VxbYM7kyfl6NPxM0MhN7LSxpSSCt cOGLownbjzuaAooMvAMjA1PcqQ0v1Zqk4NbV5wXVKsDNOyPyv7PGjWXI8QBFINPWBysR 1KIUSftR1t+b2SZoNdM9PxYJRNaKSNnpX2qTz4FwWna/7Fd6scZkU8V1wEIZS27N1TZP 9Zs3hqDQxjziPo/xRpLcU9c1rbKZvMfQ3qiYRYXodr7P7IL1q8C4iiHGoAsJ/qvJgni7 0Whg== X-Gm-Message-State: ANhLgQ2qdjFmoR7bkdl7ZKypgh+nkSkVIPM+79YOHXTh2yr9XIn04DEZ Z0YpvMo2Ip1R1DjmQpSwGhOO9gmlRhbcW5m+3nBdoRxKT4A= X-Google-Smtp-Source: ADFU+vs+t7cmamUAkGeCPZWQe15f2ARDCtA+sEcR09v1mN9nu4YPLisboW8MtmXo1p91yD88U0YX5V1/ZhA65GJMf2M= X-Received: by 2002:a05:6902:685:: with SMTP id i5mr5840971ybt.376.1584428404767; Tue, 17 Mar 2020 00:00:04 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 17 Mar 2020 01:59:53 -0500 Message-ID: Subject: [PATCH][SMB3] Add two missing flags and minor cleanup to smb2pdu.h To: CIFS , samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Minor cleanup and add one missing define (COMPRESSION_TRANSFORM_ID) and flag (TRANSFORM_FLAG_ENCRYPTED) From 92b1cde9f636aed820a6a759316ba09694a14193 Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 17 Mar 2020 01:53:39 -0500 Subject: [PATCH] SMB3: Minor cleanup of protocol definitions And add one missing define (COMPRESSION_TRANSFORM_ID) and flag (TRANSFORM_FLAG_ENCRYPTED) Signed-off-by: Steve French --- fs/cifs/smb2pdu.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 8b9f546dd842..dda928d05c13 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -91,6 +91,7 @@ #define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe) #define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd) +#define SMB2_COMPRESSION_TRANSFORM_ID cpu_to_le32(0x424d53fc) /* * SMB2 Header Definition @@ -127,13 +128,15 @@ struct smb2_sync_pdu { #define SMB3_AES128CCM_NONCE 11 #define SMB3_AES128GCM_NONCE 12 +/* Transform flags (for 3.0 dialect this flag indicates CCM */ +#define TRANSFORM_FLAG_ENCRYPTED 0x0001 struct smb2_transform_hdr { __le32 ProtocolId; /* 0xFD 'S' 'M' 'B' */ __u8 Signature[16]; __u8 Nonce[16]; __le32 OriginalMessageSize; __u16 Reserved1; - __le16 Flags; /* EncryptionAlgorithm */ + __le16 Flags; /* EncryptionAlgorithm for 3.0, enc enabled for 3.1.1 */ __u64 SessionId; } __packed; @@ -207,6 +210,10 @@ struct smb2_error_context_rsp { __u8 ErrorContextData; /* ErrorDataLength long array */ } __packed; +/* ErrorId values */ +#define SMB2_ERROR_ID_DEFAULT 0x00000000 +#define SMB2_ERROR_ID_SHARE_REDIRECT cpu_to_le32(0x72645253) /* "rdRS" */ + /* Defines for Type field below (see MS-SMB2 2.2.2.2.2.1) */ #define MOVE_DST_IPADDR_V4 cpu_to_le32(0x00000001) #define MOVE_DST_IPADDR_V6 cpu_to_le32(0x00000002) @@ -427,7 +434,7 @@ struct smb2_logoff_rsp { struct smb2_tree_connect_req { struct smb2_sync_hdr sync_hdr; __le16 StructureSize; /* Must be 9 */ - __le16 Reserved; /* Flags in SMB3.1.1 */ + __le16 Flags; /* Reserved MBZ for dialects prior to SMB3.1.1 */ __le16 PathOffset; __le16 PathLength; __u8 Buffer[1]; /* variable length */ @@ -654,7 +661,7 @@ struct smb2_tree_disconnect_rsp { | FILE_WRITE_EA_LE | FILE_WRITE_ATTRIBUTES_LE) #define FILE_EXEC_RIGHTS_LE (FILE_EXECUTE_LE) -/* Impersonation Levels */ +/* Impersonation Levels. See MS-WPO section 9.7 and MSDN-IMPERS */ #define IL_ANONYMOUS cpu_to_le32(0x00000000) #define IL_IDENTIFICATION cpu_to_le32(0x00000001) #define IL_IMPERSONATION cpu_to_le32(0x00000002) @@ -760,7 +767,7 @@ struct create_context { #define SMB2_LEASE_HANDLE_CACHING cpu_to_le32(0x02) #define SMB2_LEASE_WRITE_CACHING cpu_to_le32(0x04) -#define SMB2_LEASE_FLAG_BREAK_IN_PROGRESS cpu_to_le32(0x02) +#define SMB2_LEASE_FLAG_BREAK_IN_PROGRESS cpu_to_le32(0x00000002) #define SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET cpu_to_le32(0x00000004) #define SMB2_LEASE_KEY_SIZE 16 -- 2.20.1