diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-19 11:35:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-19 11:35:42 -0400 |
commit | 24420862bfb0db7c6b950b51dfecf3066766cb61 (patch) | |
tree | 265881c84f36e5c427aa8856277f52e105866c3d | |
parent | ebb2c2437d8008d46796902ff390653822af6cc4 (diff) | |
parent | 94a9daeaece415ce37ccb413b49a580e68e3477b (diff) |
Merge tag '4.14-smb3-multidialect-support-and-fixes-for-stable' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French:
"Convert default dialect to smb2.1 or later to allow connecting to
Windows 7 for example, also includes some fixes for stable"
* tag '4.14-smb3-multidialect-support-and-fixes-for-stable' of git://git.samba.org/sfrench/cifs-2.6:
Update version of cifs module
cifs: hide unused functions
SMB3: Add support for multidialect negotiate (SMB2.1 and later)
CIFS/SMB3: Update documentation to reflect SMB3 and various changes
cifs: check rsp for NULL before dereferencing in SMB2_open
-rw-r--r-- | Documentation/filesystems/cifs/AUTHORS | 5 | ||||
-rw-r--r-- | Documentation/filesystems/cifs/README | 81 | ||||
-rw-r--r-- | Documentation/filesystems/cifs/TODO | 72 | ||||
-rw-r--r-- | Documentation/filesystems/cifs/cifs.txt | 24 | ||||
-rw-r--r-- | fs/cifs/cifsfs.h | 2 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 6 | ||||
-rw-r--r-- | fs/cifs/connect.c | 24 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 42 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.c | 89 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.h | 2 |
10 files changed, 235 insertions, 112 deletions
diff --git a/Documentation/filesystems/cifs/AUTHORS b/Documentation/filesystems/cifs/AUTHORS index c98800df677f..9f4f87e16240 100644 --- a/Documentation/filesystems/cifs/AUTHORS +++ b/Documentation/filesystems/cifs/AUTHORS | |||
@@ -41,6 +41,11 @@ Igor Mammedov (DFS support) | |||
41 | Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) | 41 | Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) |
42 | Scott Lovenberg | 42 | Scott Lovenberg |
43 | Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) | 43 | Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features) |
44 | Aurelien Aptel (for DFS SMB3 work and some key bug fixes) | ||
45 | Ronnie Sahlberg (for SMB3 xattr work and bug fixes) | ||
46 | Shirish Pargaonkar (for many ACL patches over the years) | ||
47 | Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security) | ||
48 | |||
44 | 49 | ||
45 | Test case and Bug Report contributors | 50 | Test case and Bug Report contributors |
46 | ------------------------------------- | 51 | ------------------------------------- |
diff --git a/Documentation/filesystems/cifs/README b/Documentation/filesystems/cifs/README index a54788405429..a9da51553ba3 100644 --- a/Documentation/filesystems/cifs/README +++ b/Documentation/filesystems/cifs/README | |||
@@ -1,10 +1,14 @@ | |||
1 | The CIFS VFS support for Linux supports many advanced network filesystem | 1 | This module supports the SMB3 family of advanced network protocols (as well |
2 | features such as hierarchical dfs like namespace, hardlinks, locking and more. | 2 | as older dialects, originally called "CIFS" or SMB1). |
3 | |||
4 | The CIFS VFS module for Linux supports many advanced network filesystem | ||
5 | features such as hierarchical DFS like namespace, hardlinks, locking and more. | ||
3 | It was designed to comply with the SNIA CIFS Technical Reference (which | 6 | It was designed to comply with the SNIA CIFS Technical Reference (which |
4 | supersedes the 1992 X/Open SMB Standard) as well as to perform best practice | 7 | supersedes the 1992 X/Open SMB Standard) as well as to perform best practice |
5 | practical interoperability with Windows 2000, Windows XP, Samba and equivalent | 8 | practical interoperability with Windows 2000, Windows XP, Samba and equivalent |
6 | servers. This code was developed in participation with the Protocol Freedom | 9 | servers. This code was developed in participation with the Protocol Freedom |
7 | Information Foundation. | 10 | Information Foundation. CIFS and now SMB3 has now become a defacto |
11 | standard for interoperating between Macs and Windows and major NAS appliances. | ||
8 | 12 | ||
9 | Please see | 13 | Please see |
10 | http://protocolfreedom.org/ and | 14 | http://protocolfreedom.org/ and |
@@ -15,30 +19,11 @@ for more details. | |||
15 | For questions or bug reports please contact: | 19 | For questions or bug reports please contact: |
16 | sfrench@samba.org (sfrench@us.ibm.com) | 20 | sfrench@samba.org (sfrench@us.ibm.com) |
17 | 21 | ||
22 | See the project page at: https://wiki.samba.org/index.php/LinuxCIFS_utils | ||
23 | |||
18 | Build instructions: | 24 | Build instructions: |
19 | ================== | 25 | ================== |
20 | For Linux 2.4: | 26 | For Linux: |
21 | 1) Get the kernel source (e.g.from http://www.kernel.org) | ||
22 | and download the cifs vfs source (see the project page | ||
23 | at http://us1.samba.org/samba/Linux_CIFS_client.html) | ||
24 | and change directory into the top of the kernel directory | ||
25 | then patch the kernel (e.g. "patch -p1 < cifs_24.patch") | ||
26 | to add the cifs vfs to your kernel configure options if | ||
27 | it has not already been added (e.g. current SuSE and UL | ||
28 | users do not need to apply the cifs_24.patch since the cifs vfs is | ||
29 | already in the kernel configure menu) and then | ||
30 | mkdir linux/fs/cifs and then copy the current cifs vfs files from | ||
31 | the cifs download to your kernel build directory e.g. | ||
32 | |||
33 | cp <cifs_download_dir>/fs/cifs/* to <kernel_download_dir>/fs/cifs | ||
34 | |||
35 | 2) make menuconfig (or make xconfig) | ||
36 | 3) select cifs from within the network filesystem choices | ||
37 | 4) save and exit | ||
38 | 5) make dep | ||
39 | 6) make modules (or "make" if CIFS VFS not to be built as a module) | ||
40 | |||
41 | For Linux 2.6: | ||
42 | 1) Download the kernel (e.g. from http://www.kernel.org) | 27 | 1) Download the kernel (e.g. from http://www.kernel.org) |
43 | and change directory into the top of the kernel directory tree | 28 | and change directory into the top of the kernel directory tree |
44 | (e.g. /usr/src/linux-2.5.73) | 29 | (e.g. /usr/src/linux-2.5.73) |
@@ -61,16 +46,13 @@ would simply type "make install"). | |||
61 | If you do not have the utility mount.cifs (in the Samba 3.0 source tree and on | 46 | If you do not have the utility mount.cifs (in the Samba 3.0 source tree and on |
62 | the CIFS VFS web site) copy it to the same directory in which mount.smbfs and | 47 | the CIFS VFS web site) copy it to the same directory in which mount.smbfs and |
63 | similar files reside (usually /sbin). Although the helper software is not | 48 | similar files reside (usually /sbin). Although the helper software is not |
64 | required, mount.cifs is recommended. Eventually the Samba 3.0 utility program | 49 | required, mount.cifs is recommended. Most distros include a "cifs-utils" |
65 | "net" may also be helpful since it may someday provide easier mount syntax for | 50 | package that includes this utility so it is recommended to install this. |
66 | users who are used to Windows e.g. | 51 | |
67 | net use <mount point> <UNC name or cifs URL> | ||
68 | Note that running the Winbind pam/nss module (logon service) on all of your | 52 | Note that running the Winbind pam/nss module (logon service) on all of your |
69 | Linux clients is useful in mapping Uids and Gids consistently across the | 53 | Linux clients is useful in mapping Uids and Gids consistently across the |
70 | domain to the proper network user. The mount.cifs mount helper can be | 54 | domain to the proper network user. The mount.cifs mount helper can be |
71 | trivially built from Samba 3.0 or later source e.g. by executing: | 55 | found at cifs-utils.git on git.samba.org |
72 | |||
73 | gcc samba/source/client/mount.cifs.c -o mount.cifs | ||
74 | 56 | ||
75 | If cifs is built as a module, then the size and number of network buffers | 57 | If cifs is built as a module, then the size and number of network buffers |
76 | and maximum number of simultaneous requests to one server can be configured. | 58 | and maximum number of simultaneous requests to one server can be configured. |
@@ -79,6 +61,18 @@ Changing these from their defaults is not recommended. By executing modinfo | |||
79 | on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made | 61 | on kernel/fs/cifs/cifs.ko the list of configuration changes that can be made |
80 | at module initialization time (by running insmod cifs.ko) can be seen. | 62 | at module initialization time (by running insmod cifs.ko) can be seen. |
81 | 63 | ||
64 | Recommendations | ||
65 | =============== | ||
66 | To improve security the SMB2.1 dialect or later (usually will get SMB3) is now | ||
67 | the new default. To use old dialects (e.g. to mount Windows XP) use "vers=1.0" | ||
68 | on mount (or vers=2.0 for Windows Vista). Note that the CIFS (vers=1.0) is | ||
69 | much older and less secure than the default dialect SMB3 which includes | ||
70 | many advanced security features such as downgrade attack detection | ||
71 | and encrypted shares and stronger signing and authentication algorithms. | ||
72 | There are additional mount options that may be helpful for SMB3 to get | ||
73 | improved POSIX behavior (NB: can use vers=3.0 to force only SMB3, never 2.1): | ||
74 | "mfsymlinks" and "cifsacl" and "idsfromsid" | ||
75 | |||
82 | Allowing User Mounts | 76 | Allowing User Mounts |
83 | ==================== | 77 | ==================== |
84 | To permit users to mount and unmount over directories they own is possible | 78 | To permit users to mount and unmount over directories they own is possible |
@@ -98,9 +92,7 @@ and execution of suid programs on the remote target would be enabled | |||
98 | by default. This can be changed, as with nfs and other filesystems, | 92 | by default. This can be changed, as with nfs and other filesystems, |
99 | by simply specifying "nosuid" among the mount options. For user mounts | 93 | by simply specifying "nosuid" among the mount options. For user mounts |
100 | though to be able to pass the suid flag to mount requires rebuilding | 94 | though to be able to pass the suid flag to mount requires rebuilding |
101 | mount.cifs with the following flag: | 95 | mount.cifs with the following flag: CIFS_ALLOW_USR_SUID |
102 | |||
103 | gcc samba/source/client/mount.cifs.c -DCIFS_ALLOW_USR_SUID -o mount.cifs | ||
104 | 96 | ||
105 | There is a corresponding manual page for cifs mounting in the Samba 3.0 and | 97 | There is a corresponding manual page for cifs mounting in the Samba 3.0 and |
106 | later source tree in docs/manpages/mount.cifs.8 | 98 | later source tree in docs/manpages/mount.cifs.8 |
@@ -189,18 +181,18 @@ applications running on the same server as Samba. | |||
189 | Use instructions: | 181 | Use instructions: |
190 | ================ | 182 | ================ |
191 | Once the CIFS VFS support is built into the kernel or installed as a module | 183 | Once the CIFS VFS support is built into the kernel or installed as a module |
192 | (cifs.o), you can use mount syntax like the following to access Samba or Windows | 184 | (cifs.ko), you can use mount syntax like the following to access Samba or |
193 | servers: | 185 | Mac or Windows servers: |
194 | 186 | ||
195 | mount -t cifs //9.53.216.11/e$ /mnt -o user=myname,pass=mypassword | 187 | mount -t cifs //9.53.216.11/e$ /mnt -o username=myname,password=mypassword |
196 | 188 | ||
197 | Before -o the option -v may be specified to make the mount.cifs | 189 | Before -o the option -v may be specified to make the mount.cifs |
198 | mount helper display the mount steps more verbosely. | 190 | mount helper display the mount steps more verbosely. |
199 | After -o the following commonly used cifs vfs specific options | 191 | After -o the following commonly used cifs vfs specific options |
200 | are supported: | 192 | are supported: |
201 | 193 | ||
202 | user=<username> | 194 | username=<username> |
203 | pass=<password> | 195 | password=<password> |
204 | domain=<domain name> | 196 | domain=<domain name> |
205 | 197 | ||
206 | Other cifs mount options are described below. Use of TCP names (in addition to | 198 | Other cifs mount options are described below. Use of TCP names (in addition to |
@@ -246,13 +238,16 @@ the Server's registry. Samba starting with version 3.10 will allow such | |||
246 | filenames (ie those which contain valid Linux characters, which normally | 238 | filenames (ie those which contain valid Linux characters, which normally |
247 | would be forbidden for Windows/CIFS semantics) as long as the server is | 239 | would be forbidden for Windows/CIFS semantics) as long as the server is |
248 | configured for Unix Extensions (and the client has not disabled | 240 | configured for Unix Extensions (and the client has not disabled |
249 | /proc/fs/cifs/LinuxExtensionsEnabled). | 241 | /proc/fs/cifs/LinuxExtensionsEnabled). In addition the mount option |
250 | 242 | "mapposix" can be used on CIFS (vers=1.0) to force the mapping of | |
243 | illegal Windows/NTFS/SMB characters to a remap range (this mount parm | ||
244 | is the default for SMB3). This remap ("mapposix") range is also | ||
245 | compatible with Mac (and "Services for Mac" on some older Windows). | ||
251 | 246 | ||
252 | CIFS VFS Mount Options | 247 | CIFS VFS Mount Options |
253 | ====================== | 248 | ====================== |
254 | A partial list of the supported mount options follows: | 249 | A partial list of the supported mount options follows: |
255 | user The user name to use when trying to establish | 250 | username The user name to use when trying to establish |
256 | the CIFS session. | 251 | the CIFS session. |
257 | password The user password. If the mount helper is | 252 | password The user password. If the mount helper is |
258 | installed, the user will be prompted for password | 253 | installed, the user will be prompted for password |
diff --git a/Documentation/filesystems/cifs/TODO b/Documentation/filesystems/cifs/TODO index 066ffddc3964..396ecfd6ff4a 100644 --- a/Documentation/filesystems/cifs/TODO +++ b/Documentation/filesystems/cifs/TODO | |||
@@ -1,4 +1,4 @@ | |||
1 | Version 2.03 August 1, 2014 | 1 | Version 2.04 September 13, 2017 |
2 | 2 | ||
3 | A Partial List of Missing Features | 3 | A Partial List of Missing Features |
4 | ================================== | 4 | ================================== |
@@ -8,73 +8,69 @@ for visible, important contributions to this module. Here | |||
8 | is a partial list of the known problems and missing features: | 8 | is a partial list of the known problems and missing features: |
9 | 9 | ||
10 | a) SMB3 (and SMB3.02) missing optional features: | 10 | a) SMB3 (and SMB3.02) missing optional features: |
11 | - RDMA | 11 | - RDMA (started) |
12 | - multichannel (started) | 12 | - multichannel (started) |
13 | - directory leases (improved metadata caching) | 13 | - directory leases (improved metadata caching) |
14 | - T10 copy offload (copy chunk is only mechanism supported) | 14 | - T10 copy offload (copy chunk is only mechanism supported) |
15 | - encrypted shares | ||
16 | 15 | ||
17 | b) improved sparse file support | 16 | b) improved sparse file support |
18 | 17 | ||
19 | c) Directory entry caching relies on a 1 second timer, rather than | 18 | c) Directory entry caching relies on a 1 second timer, rather than |
20 | using FindNotify or equivalent. - (started) | 19 | using Directory Leases |
21 | 20 | ||
22 | d) quota support (needs minor kernel change since quota calls | 21 | d) quota support (needs minor kernel change since quota calls |
23 | to make it to network filesystems or deviceless filesystems) | 22 | to make it to network filesystems or deviceless filesystems) |
24 | 23 | ||
25 | e) improve support for very old servers (OS/2 and Win9x for example) | 24 | e) Better optimize open to reduce redundant opens (using reference |
26 | Including support for changing the time remotely (utimes command). | 25 | counts more) and to improve use of compounding in SMB3 to reduce |
26 | number of roundtrips. | ||
27 | 27 | ||
28 | f) hook lower into the sockets api (as NFS/SunRPC does) to avoid the | 28 | f) Finish inotify support so kde and gnome file list windows |
29 | extra copy in/out of the socket buffers in some cases. | ||
30 | |||
31 | g) Better optimize open (and pathbased setfilesize) to reduce the | ||
32 | oplock breaks coming from windows srv. Piggyback identical file | ||
33 | opens on top of each other by incrementing reference count rather | ||
34 | than resending (helps reduce server resource utilization and avoid | ||
35 | spurious oplock breaks). | ||
36 | |||
37 | h) Add support for storing symlink info to Windows servers | ||
38 | in the Extended Attribute format their SFU clients would recognize. | ||
39 | |||
40 | i) Finish inotify support so kde and gnome file list windows | ||
41 | will autorefresh (partially complete by Asser). Needs minor kernel | 29 | will autorefresh (partially complete by Asser). Needs minor kernel |
42 | vfs change to support removing D_NOTIFY on a file. | 30 | vfs change to support removing D_NOTIFY on a file. |
43 | 31 | ||
44 | j) Add GUI tool to configure /proc/fs/cifs settings and for display of | 32 | g) Add GUI tool to configure /proc/fs/cifs settings and for display of |
45 | the CIFS statistics (started) | 33 | the CIFS statistics (started) |
46 | 34 | ||
47 | k) implement support for security and trusted categories of xattrs | 35 | h) implement support for security and trusted categories of xattrs |
48 | (requires minor protocol extension) to enable better support for SELINUX | 36 | (requires minor protocol extension) to enable better support for SELINUX |
49 | 37 | ||
50 | l) Implement O_DIRECT flag on open (already supported on mount) | 38 | i) Implement O_DIRECT flag on open (already supported on mount) |
51 | 39 | ||
52 | m) Create UID mapping facility so server UIDs can be mapped on a per | 40 | j) Create UID mapping facility so server UIDs can be mapped on a per |
53 | mount or a per server basis to client UIDs or nobody if no mapping | 41 | mount or a per server basis to client UIDs or nobody if no mapping |
54 | exists. This is helpful when Unix extensions are negotiated to | 42 | exists. Also better integration with winbind for resolving SID owners |
55 | allow better permission checking when UIDs differ on the server | 43 | |
56 | and client. Add new protocol request to the CIFS protocol | 44 | k) Add tools to take advantage of more smb3 specific ioctls and features |
57 | standard for asking the server for the corresponding name of a | 45 | |
58 | particular uid. | 46 | l) encrypted file support |
47 | |||
48 | m) improved stats gathering, tools (perhaps integration with nfsometer?) | ||
59 | 49 | ||
60 | n) DOS attrs - returned as pseudo-xattr in Samba format (check VFAT and NTFS for this too) | 50 | n) allow setting more NTFS/SMB3 file attributes remotely (currently limited to compressed |
51 | file attribute via chflags) and improve user space tools for managing and | ||
52 | viewing them. | ||
61 | 53 | ||
62 | o) mount check for unmatched uids | 54 | o) mount helper GUI (to simplify the various configuration options on mount) |
63 | 55 | ||
64 | p) Add support for new vfs entry point for fallocate | 56 | p) autonegotiation of dialects (offering more than one dialect ie SMB3.02, |
57 | SMB3, SMB2.1 not just SMB3). | ||
65 | 58 | ||
66 | q) Add tools to take advantage of cifs/smb3 specific ioctls and features | 59 | q) Allow mount.cifs to be more verbose in reporting errors with dialect |
67 | such as "CopyChunk" (fast server side file copy) | 60 | or unsupported feature errors. |
68 | 61 | ||
69 | r) encrypted file support | 62 | r) updating cifs documentation, and user guid. |
70 | 63 | ||
71 | s) improved stats gathering, tools (perhaps integration with nfsometer?) | 64 | s) Addressing bugs found by running a broader set of xfstests in standard |
65 | file system xfstest suite. | ||
72 | 66 | ||
73 | t) allow setting more NTFS/SMB3 file attributes remotely (currently limited to compressed | 67 | t) split cifs and smb3 support into separate modules so legacy (and less |
74 | file attribute via chflags) | 68 | secure) CIFS dialect can be disabled in environments that don't need it |
69 | and simplify the code. | ||
75 | 70 | ||
76 | u) mount helper GUI (to simplify the various configuration options on mount) | 71 | u) Finish up SMB3.1.1 dialect support |
77 | 72 | ||
73 | v) POSIX Extensions for SMB3.1.1 | ||
78 | 74 | ||
79 | KNOWN BUGS | 75 | KNOWN BUGS |
80 | ==================================== | 76 | ==================================== |
diff --git a/Documentation/filesystems/cifs/cifs.txt b/Documentation/filesystems/cifs/cifs.txt index 2fac91ac96cf..67756607246e 100644 --- a/Documentation/filesystems/cifs/cifs.txt +++ b/Documentation/filesystems/cifs/cifs.txt | |||
@@ -1,24 +1,28 @@ | |||
1 | This is the client VFS module for the Common Internet File System | 1 | This is the client VFS module for the SMB3 NAS protocol as well |
2 | (CIFS) protocol which is the successor to the Server Message Block | 2 | older dialects such as the Common Internet File System (CIFS) |
3 | protocol which was the successor to the Server Message Block | ||
3 | (SMB) protocol, the native file sharing mechanism for most early | 4 | (SMB) protocol, the native file sharing mechanism for most early |
4 | PC operating systems. New and improved versions of CIFS are now | 5 | PC operating systems. New and improved versions of CIFS are now |
5 | called SMB2 and SMB3. These dialects are also supported by the | 6 | called SMB2 and SMB3. These dialects are also supported by the |
6 | CIFS VFS module. CIFS is fully supported by network | 7 | CIFS VFS module. CIFS is fully supported by network |
7 | file servers such as Windows 2000, 2003, 2008 and 2012 | 8 | file servers such as Windows 2000, 2003, 2008, 2012 and 2016 |
8 | as well by Samba (which provides excellent CIFS | 9 | as well by Samba (which provides excellent CIFS |
9 | server support for Linux and many other operating systems), so | 10 | server support for Linux and many other operating systems), Apple |
11 | systems, as well as most Network Attached Storage vendors, so | ||
10 | this network filesystem client can mount to a wide variety of | 12 | this network filesystem client can mount to a wide variety of |
11 | servers. | 13 | servers. |
12 | 14 | ||
13 | The intent of this module is to provide the most advanced network | 15 | The intent of this module is to provide the most advanced network |
14 | file system function for CIFS compliant servers, including better | 16 | file system function for SMB3 compliant servers, including advanced |
15 | POSIX compliance, secure per-user session establishment, high | 17 | security features, excellent parallelized high performance i/o, better |
16 | performance safe distributed caching (oplock), optional packet | 18 | POSIX compliance, secure per-user session establishment, encryption, |
19 | high performance safe distributed caching (leases/oplocks), optional packet | ||
17 | signing, large files, Unicode support and other internationalization | 20 | signing, large files, Unicode support and other internationalization |
18 | improvements. Since both Samba server and this filesystem client support | 21 | improvements. Since both Samba server and this filesystem client support |
19 | the CIFS Unix extensions, the combination can provide a reasonable | 22 | the CIFS Unix extensions (and in the future SMB3 POSIX extensions), |
20 | alternative to NFSv4 for fileserving in some Linux to Linux environments, | 23 | the combination can provide a reasonable alternative to other network and |
21 | not just in Linux to Windows environments. | 24 | cluster file systems for fileserving in some Linux to Linux environments, |
25 | not just in Linux to Windows (or Linux to Mac) environments. | ||
22 | 26 | ||
23 | This filesystem has an mount utility (mount.cifs) that can be obtained from | 27 | This filesystem has an mount utility (mount.cifs) that can be obtained from |
24 | 28 | ||
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 30bf89b1fd9a..5a10e566f0e6 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -149,5 +149,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | |||
149 | extern const struct export_operations cifs_export_ops; | 149 | extern const struct export_operations cifs_export_ops; |
150 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ | 150 | #endif /* CONFIG_CIFS_NFSD_EXPORT */ |
151 | 151 | ||
152 | #define CIFS_VERSION "2.09" | 152 | #define CIFS_VERSION "2.10" |
153 | #endif /* _CIFSFS_H */ | 153 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 808486c29f0d..de5b2e1fcce5 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -188,6 +188,8 @@ enum smb_version { | |||
188 | #ifdef CONFIG_CIFS_SMB311 | 188 | #ifdef CONFIG_CIFS_SMB311 |
189 | Smb_311, | 189 | Smb_311, |
190 | #endif /* SMB311 */ | 190 | #endif /* SMB311 */ |
191 | Smb_3any, | ||
192 | Smb_default, | ||
191 | Smb_version_err | 193 | Smb_version_err |
192 | }; | 194 | }; |
193 | 195 | ||
@@ -1701,6 +1703,10 @@ extern struct smb_version_values smb20_values; | |||
1701 | #define SMB21_VERSION_STRING "2.1" | 1703 | #define SMB21_VERSION_STRING "2.1" |
1702 | extern struct smb_version_operations smb21_operations; | 1704 | extern struct smb_version_operations smb21_operations; |
1703 | extern struct smb_version_values smb21_values; | 1705 | extern struct smb_version_values smb21_values; |
1706 | #define SMBDEFAULT_VERSION_STRING "default" | ||
1707 | extern struct smb_version_values smbdefault_values; | ||
1708 | #define SMB3ANY_VERSION_STRING "3" | ||
1709 | extern struct smb_version_values smb3any_values; | ||
1704 | #define SMB30_VERSION_STRING "3.0" | 1710 | #define SMB30_VERSION_STRING "3.0" |
1705 | extern struct smb_version_operations smb30_operations; | 1711 | extern struct smb_version_operations smb30_operations; |
1706 | extern struct smb_version_values smb30_values; | 1712 | extern struct smb_version_values smb30_values; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5aa2d278ca84..8d38b22afb2b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -301,6 +301,8 @@ static const match_table_t cifs_smb_version_tokens = { | |||
301 | { Smb_311, SMB311_VERSION_STRING }, | 301 | { Smb_311, SMB311_VERSION_STRING }, |
302 | { Smb_311, ALT_SMB311_VERSION_STRING }, | 302 | { Smb_311, ALT_SMB311_VERSION_STRING }, |
303 | #endif /* SMB311 */ | 303 | #endif /* SMB311 */ |
304 | { Smb_3any, SMB3ANY_VERSION_STRING }, | ||
305 | { Smb_default, SMBDEFAULT_VERSION_STRING }, | ||
304 | { Smb_version_err, NULL } | 306 | { Smb_version_err, NULL } |
305 | }; | 307 | }; |
306 | 308 | ||
@@ -1148,6 +1150,14 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol) | |||
1148 | vol->vals = &smb311_values; | 1150 | vol->vals = &smb311_values; |
1149 | break; | 1151 | break; |
1150 | #endif /* SMB311 */ | 1152 | #endif /* SMB311 */ |
1153 | case Smb_3any: | ||
1154 | vol->ops = &smb30_operations; /* currently identical with 3.0 */ | ||
1155 | vol->vals = &smb3any_values; | ||
1156 | break; | ||
1157 | case Smb_default: | ||
1158 | vol->ops = &smb30_operations; /* currently identical with 3.0 */ | ||
1159 | vol->vals = &smbdefault_values; | ||
1160 | break; | ||
1151 | default: | 1161 | default: |
1152 | cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value); | 1162 | cifs_dbg(VFS, "Unknown vers= option specified: %s\n", value); |
1153 | return 1; | 1163 | return 1; |
@@ -1274,9 +1284,9 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1274 | 1284 | ||
1275 | vol->actimeo = CIFS_DEF_ACTIMEO; | 1285 | vol->actimeo = CIFS_DEF_ACTIMEO; |
1276 | 1286 | ||
1277 | /* FIXME: add autonegotiation for SMB3 or later rather than just SMB3 */ | 1287 | /* offer SMB2.1 and later (SMB3 etc). Secure and widely accepted */ |
1278 | vol->ops = &smb30_operations; /* both secure and accepted widely */ | 1288 | vol->ops = &smb30_operations; |
1279 | vol->vals = &smb30_values; | 1289 | vol->vals = &smbdefault_values; |
1280 | 1290 | ||
1281 | vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; | 1291 | vol->echo_interval = SMB_ECHO_INTERVAL_DEFAULT; |
1282 | 1292 | ||
@@ -1988,11 +1998,10 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1988 | 1998 | ||
1989 | if (got_version == false) | 1999 | if (got_version == false) |
1990 | pr_warn("No dialect specified on mount. Default has changed to " | 2000 | pr_warn("No dialect specified on mount. Default has changed to " |
1991 | "a more secure dialect, SMB3 (vers=3.0), from CIFS " | 2001 | "a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS " |
1992 | "(SMB1). To use the less secure SMB1 dialect to access " | 2002 | "(SMB1). To use the less secure SMB1 dialect to access " |
1993 | "old servers which do not support SMB3 specify vers=1.0" | 2003 | "old servers which do not support SMB3 (or SMB2.1) specify vers=1.0" |
1994 | " on mount. For somewhat newer servers such as Windows " | 2004 | " on mount.\n"); |
1995 | "7 try vers=2.1.\n"); | ||
1996 | 2005 | ||
1997 | kfree(mountdata_copy); | 2006 | kfree(mountdata_copy); |
1998 | return 0; | 2007 | return 0; |
@@ -2133,6 +2142,7 @@ static int match_server(struct TCP_Server_Info *server, struct smb_vol *vol) | |||
2133 | if (vol->nosharesock) | 2142 | if (vol->nosharesock) |
2134 | return 0; | 2143 | return 0; |
2135 | 2144 | ||
2145 | /* BB update this for smb3any and default case */ | ||
2136 | if ((server->vals != vol->vals) || (server->ops != vol->ops)) | 2146 | if ((server->vals != vol->vals) || (server->ops != vol->ops)) |
2137 | return 0; | 2147 | return 0; |
2138 | 2148 | ||
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index fb2934b9b97c..0dafdbae1f8c 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -426,6 +426,7 @@ smb2_query_file_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
426 | return rc; | 426 | return rc; |
427 | } | 427 | } |
428 | 428 | ||
429 | #ifdef CONFIG_CIFS_XATTR | ||
429 | static ssize_t | 430 | static ssize_t |
430 | move_smb2_ea_to_cifs(char *dst, size_t dst_size, | 431 | move_smb2_ea_to_cifs(char *dst, size_t dst_size, |
431 | struct smb2_file_full_ea_info *src, size_t src_size, | 432 | struct smb2_file_full_ea_info *src, size_t src_size, |
@@ -613,6 +614,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, | |||
613 | 614 | ||
614 | return rc; | 615 | return rc; |
615 | } | 616 | } |
617 | #endif | ||
616 | 618 | ||
617 | static bool | 619 | static bool |
618 | smb2_can_echo(struct TCP_Server_Info *server) | 620 | smb2_can_echo(struct TCP_Server_Info *server) |
@@ -3110,6 +3112,46 @@ struct smb_version_values smb21_values = { | |||
3110 | .create_lease_size = sizeof(struct create_lease), | 3112 | .create_lease_size = sizeof(struct create_lease), |
3111 | }; | 3113 | }; |
3112 | 3114 | ||
3115 | struct smb_version_values smb3any_values = { | ||
3116 | .version_string = SMB3ANY_VERSION_STRING, | ||
3117 | .protocol_id = SMB302_PROT_ID, /* doesn't matter, send protocol array */ | ||
3118 | .req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION, | ||
3119 | .large_lock_type = 0, | ||
3120 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
3121 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
3122 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
3123 | .header_size = sizeof(struct smb2_hdr), | ||
3124 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
3125 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
3126 | .lock_cmd = SMB2_LOCK, | ||
3127 | .cap_unix = 0, | ||
3128 | .cap_nt_find = SMB2_NT_FIND, | ||
3129 | .cap_large_files = SMB2_LARGE_FILES, | ||
3130 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
3131 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
3132 | .create_lease_size = sizeof(struct create_lease_v2), | ||
3133 | }; | ||
3134 | |||
3135 | struct smb_version_values smbdefault_values = { | ||
3136 | .version_string = SMBDEFAULT_VERSION_STRING, | ||
3137 | .protocol_id = SMB302_PROT_ID, /* doesn't matter, send protocol array */ | ||
3138 | .req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU | SMB2_GLOBAL_CAP_PERSISTENT_HANDLES | SMB2_GLOBAL_CAP_ENCRYPTION, | ||
3139 | .large_lock_type = 0, | ||
3140 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
3141 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
3142 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
3143 | .header_size = sizeof(struct smb2_hdr), | ||
3144 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
3145 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
3146 | .lock_cmd = SMB2_LOCK, | ||
3147 | .cap_unix = 0, | ||
3148 | .cap_nt_find = SMB2_NT_FIND, | ||
3149 | .cap_large_files = SMB2_LARGE_FILES, | ||
3150 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
3151 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
3152 | .create_lease_size = sizeof(struct create_lease_v2), | ||
3153 | }; | ||
3154 | |||
3113 | struct smb_version_values smb30_values = { | 3155 | struct smb_version_values smb30_values = { |
3114 | .version_string = SMB30_VERSION_STRING, | 3156 | .version_string = SMB30_VERSION_STRING, |
3115 | .protocol_id = SMB30_PROT_ID, | 3157 | .protocol_id = SMB30_PROT_ID, |
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 5531e7ee1210..5c16591a128e 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
@@ -491,10 +491,25 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
491 | 491 | ||
492 | req->hdr.sync_hdr.SessionId = 0; | 492 | req->hdr.sync_hdr.SessionId = 0; |
493 | 493 | ||
494 | req->Dialects[0] = cpu_to_le16(ses->server->vals->protocol_id); | 494 | if (strcmp(ses->server->vals->version_string, |
495 | 495 | SMB3ANY_VERSION_STRING) == 0) { | |
496 | req->DialectCount = cpu_to_le16(1); /* One vers= at a time for now */ | 496 | req->Dialects[0] = cpu_to_le16(SMB30_PROT_ID); |
497 | inc_rfc1001_len(req, 2); | 497 | req->Dialects[1] = cpu_to_le16(SMB302_PROT_ID); |
498 | req->DialectCount = cpu_to_le16(2); | ||
499 | inc_rfc1001_len(req, 4); | ||
500 | } else if (strcmp(ses->server->vals->version_string, | ||
501 | SMBDEFAULT_VERSION_STRING) == 0) { | ||
502 | req->Dialects[0] = cpu_to_le16(SMB21_PROT_ID); | ||
503 | req->Dialects[1] = cpu_to_le16(SMB30_PROT_ID); | ||
504 | req->Dialects[2] = cpu_to_le16(SMB302_PROT_ID); | ||
505 | req->DialectCount = cpu_to_le16(3); | ||
506 | inc_rfc1001_len(req, 6); | ||
507 | } else { | ||
508 | /* otherwise send specific dialect */ | ||
509 | req->Dialects[0] = cpu_to_le16(ses->server->vals->protocol_id); | ||
510 | req->DialectCount = cpu_to_le16(1); | ||
511 | inc_rfc1001_len(req, 2); | ||
512 | } | ||
498 | 513 | ||
499 | /* only one of SMB2 signing flags may be set in SMB2 request */ | 514 | /* only one of SMB2 signing flags may be set in SMB2 request */ |
500 | if (ses->sign) | 515 | if (ses->sign) |
@@ -528,16 +543,42 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
528 | */ | 543 | */ |
529 | if (rc == -EOPNOTSUPP) { | 544 | if (rc == -EOPNOTSUPP) { |
530 | cifs_dbg(VFS, "Dialect not supported by server. Consider " | 545 | cifs_dbg(VFS, "Dialect not supported by server. Consider " |
531 | "specifying vers=1.0 or vers=2.1 on mount for accessing" | 546 | "specifying vers=1.0 or vers=2.0 on mount for accessing" |
532 | " older servers\n"); | 547 | " older servers\n"); |
533 | goto neg_exit; | 548 | goto neg_exit; |
534 | } else if (rc != 0) | 549 | } else if (rc != 0) |
535 | goto neg_exit; | 550 | goto neg_exit; |
536 | 551 | ||
552 | if (strcmp(ses->server->vals->version_string, | ||
553 | SMB3ANY_VERSION_STRING) == 0) { | ||
554 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) { | ||
555 | cifs_dbg(VFS, | ||
556 | "SMB2 dialect returned but not requested\n"); | ||
557 | return -EIO; | ||
558 | } else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) { | ||
559 | cifs_dbg(VFS, | ||
560 | "SMB2.1 dialect returned but not requested\n"); | ||
561 | return -EIO; | ||
562 | } | ||
563 | } else if (strcmp(ses->server->vals->version_string, | ||
564 | SMBDEFAULT_VERSION_STRING) == 0) { | ||
565 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) { | ||
566 | cifs_dbg(VFS, | ||
567 | "SMB2 dialect returned but not requested\n"); | ||
568 | return -EIO; | ||
569 | } else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) { | ||
570 | /* ops set to 3.0 by default for default so update */ | ||
571 | ses->server->ops = &smb21_operations; | ||
572 | } | ||
573 | } else if (rsp->DialectRevision != ses->server->vals->protocol_id) { | ||
574 | /* if requested single dialect ensure returned dialect matched */ | ||
575 | cifs_dbg(VFS, "Illegal 0x%x dialect returned: not requested\n", | ||
576 | cpu_to_le16(rsp->DialectRevision)); | ||
577 | return -EIO; | ||
578 | } | ||
579 | |||
537 | cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode); | 580 | cifs_dbg(FYI, "mode 0x%x\n", rsp->SecurityMode); |
538 | 581 | ||
539 | /* BB we may eventually want to match the negotiated vs. requested | ||
540 | dialect, even though we are only requesting one at a time */ | ||
541 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) | 582 | if (rsp->DialectRevision == cpu_to_le16(SMB20_PROT_ID)) |
542 | cifs_dbg(FYI, "negotiated smb2.0 dialect\n"); | 583 | cifs_dbg(FYI, "negotiated smb2.0 dialect\n"); |
543 | else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) | 584 | else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) |
@@ -558,6 +599,8 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) | |||
558 | } | 599 | } |
559 | server->dialect = le16_to_cpu(rsp->DialectRevision); | 600 | server->dialect = le16_to_cpu(rsp->DialectRevision); |
560 | 601 | ||
602 | /* BB: add check that dialect was valid given dialect(s) we asked for */ | ||
603 | |||
561 | /* SMB2 only has an extended negflavor */ | 604 | /* SMB2 only has an extended negflavor */ |
562 | server->negflavor = CIFS_NEGFLAVOR_EXTENDED; | 605 | server->negflavor = CIFS_NEGFLAVOR_EXTENDED; |
563 | /* set it to the maximum buffer size value we can send with 1 credit */ | 606 | /* set it to the maximum buffer size value we can send with 1 credit */ |
@@ -606,6 +649,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |||
606 | struct validate_negotiate_info_req vneg_inbuf; | 649 | struct validate_negotiate_info_req vneg_inbuf; |
607 | struct validate_negotiate_info_rsp *pneg_rsp; | 650 | struct validate_negotiate_info_rsp *pneg_rsp; |
608 | u32 rsplen; | 651 | u32 rsplen; |
652 | u32 inbuflen; /* max of 4 dialects */ | ||
609 | 653 | ||
610 | cifs_dbg(FYI, "validate negotiate\n"); | 654 | cifs_dbg(FYI, "validate negotiate\n"); |
611 | 655 | ||
@@ -634,9 +678,30 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) | |||
634 | else | 678 | else |
635 | vneg_inbuf.SecurityMode = 0; | 679 | vneg_inbuf.SecurityMode = 0; |
636 | 680 | ||
637 | vneg_inbuf.DialectCount = cpu_to_le16(1); | 681 | |
638 | vneg_inbuf.Dialects[0] = | 682 | if (strcmp(tcon->ses->server->vals->version_string, |
639 | cpu_to_le16(tcon->ses->server->vals->protocol_id); | 683 | SMB3ANY_VERSION_STRING) == 0) { |
684 | vneg_inbuf.Dialects[0] = cpu_to_le16(SMB30_PROT_ID); | ||
685 | vneg_inbuf.Dialects[1] = cpu_to_le16(SMB302_PROT_ID); | ||
686 | vneg_inbuf.DialectCount = cpu_to_le16(2); | ||
687 | /* structure is big enough for 3 dialects, sending only 2 */ | ||
688 | inbuflen = sizeof(struct validate_negotiate_info_req) - 2; | ||
689 | } else if (strcmp(tcon->ses->server->vals->version_string, | ||
690 | SMBDEFAULT_VERSION_STRING) == 0) { | ||
691 | vneg_inbuf.Dialects[0] = cpu_to_le16(SMB21_PROT_ID); | ||
692 | vneg_inbuf.Dialects[1] = cpu_to_le16(SMB30_PROT_ID); | ||
693 | vneg_inbuf.Dialects[2] = cpu_to_le16(SMB302_PROT_ID); | ||
694 | vneg_inbuf.DialectCount = cpu_to_le16(3); | ||
695 | /* structure is big enough for 3 dialects */ | ||
696 | inbuflen = sizeof(struct validate_negotiate_info_req); | ||
697 | } else { | ||
698 | /* otherwise specific dialect was requested */ | ||
699 | vneg_inbuf.Dialects[0] = | ||
700 | cpu_to_le16(tcon->ses->server->vals->protocol_id); | ||
701 | vneg_inbuf.DialectCount = cpu_to_le16(1); | ||
702 | /* structure is big enough for 3 dialects, sending only 1 */ | ||
703 | inbuflen = sizeof(struct validate_negotiate_info_req) - 4; | ||
704 | } | ||
640 | 705 | ||
641 | rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, | 706 | rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, |
642 | FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, | 707 | FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, |
@@ -1634,7 +1699,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, | |||
1634 | struct cifs_tcon *tcon = oparms->tcon; | 1699 | struct cifs_tcon *tcon = oparms->tcon; |
1635 | struct cifs_ses *ses = tcon->ses; | 1700 | struct cifs_ses *ses = tcon->ses; |
1636 | struct kvec iov[4]; | 1701 | struct kvec iov[4]; |
1637 | struct kvec rsp_iov; | 1702 | struct kvec rsp_iov = {NULL, 0}; |
1638 | int resp_buftype; | 1703 | int resp_buftype; |
1639 | int uni_path_len; | 1704 | int uni_path_len; |
1640 | __le16 *copy_path = NULL; | 1705 | __le16 *copy_path = NULL; |
@@ -1763,7 +1828,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, | |||
1763 | 1828 | ||
1764 | if (rc != 0) { | 1829 | if (rc != 0) { |
1765 | cifs_stats_fail_inc(tcon, SMB2_CREATE_HE); | 1830 | cifs_stats_fail_inc(tcon, SMB2_CREATE_HE); |
1766 | if (err_buf) | 1831 | if (err_buf && rsp) |
1767 | *err_buf = kmemdup(rsp, get_rfc1002_length(rsp) + 4, | 1832 | *err_buf = kmemdup(rsp, get_rfc1002_length(rsp) + 4, |
1768 | GFP_KERNEL); | 1833 | GFP_KERNEL); |
1769 | goto creat_exit; | 1834 | goto creat_exit; |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 393ed5f4e1b6..6c9653a130c8 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -716,7 +716,7 @@ struct validate_negotiate_info_req { | |||
716 | __u8 Guid[SMB2_CLIENT_GUID_SIZE]; | 716 | __u8 Guid[SMB2_CLIENT_GUID_SIZE]; |
717 | __le16 SecurityMode; | 717 | __le16 SecurityMode; |
718 | __le16 DialectCount; | 718 | __le16 DialectCount; |
719 | __le16 Dialects[1]; /* dialect (someday maybe list) client asked for */ | 719 | __le16 Dialects[3]; /* BB expand this if autonegotiate > 3 dialects */ |
720 | } __packed; | 720 | } __packed; |
721 | 721 | ||
722 | struct validate_negotiate_info_rsp { | 722 | struct validate_negotiate_info_rsp { |