diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5aa2d278ca84..0bfc2280436d 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 | ||
@@ -4144,6 +4154,14 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses, | |||
4144 | cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n", | 4154 | cifs_dbg(FYI, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d\n", |
4145 | server->sec_mode, server->capabilities, server->timeAdj); | 4155 | server->sec_mode, server->capabilities, server->timeAdj); |
4146 | 4156 | ||
4157 | if (ses->auth_key.response) { | ||
4158 | cifs_dbg(VFS, "Free previous auth_key.response = %p\n", | ||
4159 | ses->auth_key.response); | ||
4160 | kfree(ses->auth_key.response); | ||
4161 | ses->auth_key.response = NULL; | ||
4162 | ses->auth_key.len = 0; | ||
4163 | } | ||
4164 | |||
4147 | if (server->ops->sess_setup) | 4165 | if (server->ops->sess_setup) |
4148 | rc = server->ops->sess_setup(xid, ses, nls_info); | 4166 | rc = server->ops->sess_setup(xid, ses, nls_info); |
4149 | 4167 | ||