Skip to content

Commit a91e113

Browse files
committed
Merge tag 'v6.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - important fix for reconnect problem - minor cleanup * tag 'v6.19-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number smb: move some SMB1 definitions into common/smb1pdu.h smb: align durable reconnect v2 context to 8 byte boundary
2 parents 9a903e6 + d8a4af8 commit a91e113

6 files changed

Lines changed: 61 additions & 45 deletions

File tree

fs/smb/client/cifsfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ extern const struct export_operations cifs_export_ops;
145145
#endif /* CONFIG_CIFS_NFSD_EXPORT */
146146

147147
/* when changing internal version - update following two lines at same time */
148-
#define SMB3_PRODUCT_BUILD 57
149-
#define CIFS_VERSION "2.57"
148+
#define SMB3_PRODUCT_BUILD 58
149+
#define CIFS_VERSION "2.58"
150150
#endif /* _CIFSFS_H */

fs/smb/client/cifspdu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <net/sock.h>
1313
#include <linux/unaligned.h>
1414
#include "../common/smbfsctl.h"
15-
#include "../common/smb2pdu.h"
15+
#include "../common/smb1pdu.h"
1616

1717
#define CIFS_PROT 0
1818
#define POSIX_PROT (CIFS_PROT+1)

fs/smb/common/smb1pdu.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* SPDX-License-Identifier: LGPL-2.1 */
2+
/*
3+
*
4+
* Copyright (C) International Business Machines Corp., 2002,2009
5+
* 2018 Samsung Electronics Co., Ltd.
6+
* Author(s): Steve French <sfrench@us.ibm.com>
7+
* Namjae Jeon <linkinjeon@kernel.org>
8+
*
9+
*/
10+
11+
#ifndef _COMMON_SMB1_PDU_H
12+
#define _COMMON_SMB1_PDU_H
13+
14+
#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff)
15+
16+
/*
17+
* See MS-CIFS 2.2.3.1
18+
* MS-SMB 2.2.3.1
19+
*/
20+
struct smb_hdr {
21+
__u8 Protocol[4];
22+
__u8 Command;
23+
union {
24+
struct {
25+
__u8 ErrorClass;
26+
__u8 Reserved;
27+
__le16 Error;
28+
} __packed DosError;
29+
__le32 CifsError;
30+
} __packed Status;
31+
__u8 Flags;
32+
__le16 Flags2; /* note: le */
33+
__le16 PidHigh;
34+
union {
35+
struct {
36+
__le32 SequenceNumber; /* le */
37+
__u32 Reserved; /* zero */
38+
} __packed Sequence;
39+
__u8 SecuritySignature[8]; /* le */
40+
} __packed Signature;
41+
__u8 pad[2];
42+
__u16 Tid;
43+
__le16 Pid;
44+
__u16 Uid;
45+
__le16 Mid;
46+
__u8 WordCount;
47+
} __packed;
48+
49+
/* See MS-CIFS 2.2.4.52.1 */
50+
typedef struct smb_negotiate_req {
51+
struct smb_hdr hdr; /* wct = 0 */
52+
__le16 ByteCount;
53+
unsigned char DialectsArray[];
54+
} __packed SMB_NEGOTIATE_REQ;
55+
56+
#endif /* _COMMON_SMB1_PDU_H */

fs/smb/common/smb2pdu.h

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ struct create_durable_handle_reconnect_v2 {
12931293
struct create_context_hdr ccontext;
12941294
__u8 Name[8];
12951295
struct durable_reconnect_context_v2 dcontext;
1296+
__u8 Pad[4];
12961297
} __packed;
12971298

12981299
/* See MS-SMB2 2.2.14.2.12 */
@@ -1985,39 +1986,6 @@ struct smb2_lease_ack {
19851986
__le64 LeaseDuration;
19861987
} __packed;
19871988

1988-
/*
1989-
* See MS-CIFS 2.2.3.1
1990-
* MS-SMB 2.2.3.1
1991-
*/
1992-
struct smb_hdr {
1993-
__u8 Protocol[4];
1994-
__u8 Command;
1995-
union {
1996-
struct {
1997-
__u8 ErrorClass;
1998-
__u8 Reserved;
1999-
__le16 Error;
2000-
} __packed DosError;
2001-
__le32 CifsError;
2002-
} __packed Status;
2003-
__u8 Flags;
2004-
__le16 Flags2; /* note: le */
2005-
__le16 PidHigh;
2006-
union {
2007-
struct {
2008-
__le32 SequenceNumber; /* le */
2009-
__u32 Reserved; /* zero */
2010-
} __packed Sequence;
2011-
__u8 SecuritySignature[8]; /* le */
2012-
} __packed Signature;
2013-
__u8 pad[2];
2014-
__u16 Tid;
2015-
__le16 Pid;
2016-
__u16 Uid;
2017-
__le16 Mid;
2018-
__u8 WordCount;
2019-
} __packed;
2020-
20211989
#define OP_BREAK_STRUCT_SIZE_20 24
20221990
#define OP_BREAK_STRUCT_SIZE_21 36
20231991

@@ -2122,11 +2090,4 @@ struct smb_hdr {
21222090
#define SET_MINIMUM_RIGHTS (FILE_READ_EA | FILE_READ_ATTRIBUTES \
21232091
| READ_CONTROL | SYNCHRONIZE)
21242092

2125-
/* See MS-CIFS 2.2.4.52.1 */
2126-
typedef struct smb_negotiate_req {
2127-
struct smb_hdr hdr; /* wct = 0 */
2128-
__le16 ByteCount;
2129-
unsigned char DialectsArray[];
2130-
} __packed SMB_NEGOTIATE_REQ;
2131-
21322093
#endif /* _COMMON_SMB2PDU_H */

fs/smb/common/smbglob.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#ifndef _COMMON_SMB_GLOB_H
1212
#define _COMMON_SMB_GLOB_H
1313

14-
#define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff)
15-
1614
struct smb_version_values {
1715
char *version_string;
1816
__u16 protocol_id;

fs/smb/server/smb_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "glob.h"
1212
#include "../common/smbglob.h"
13+
#include "../common/smb1pdu.h"
1314
#include "../common/smb2pdu.h"
1415
#include "../common/fscc.h"
1516
#include "smb2pdu.h"

0 commit comments

Comments
 (0)