Commit d9b94201 authored by Steve French's avatar Steve French

[CIFS] Warn on requesting default security (ntlm) on mount

Warn once if default security (ntlm) requested. We will
update the default to the stronger security mechanism
(ntlmv2) in 2.6.41.  Kerberos is also stronger than
ntlm, but more servers support ntlmv2 and ntlmv2
does not require an upcall, so ntlmv2 is a better
default.
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
CC: Suresh Jayaraman <sjayaraman@suse.de>
Reviewed-by: default avatarShirish Pargaonkar <shirishp@us.ibm.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent fd88ce93
...@@ -1854,6 +1854,8 @@ cifs_put_smb_ses(struct cifsSesInfo *ses) ...@@ -1854,6 +1854,8 @@ cifs_put_smb_ses(struct cifsSesInfo *ses)
cifs_put_tcp_session(server); cifs_put_tcp_session(server);
} }
static bool warned_on_ntlm; /* globals init to false automatically */
static struct cifsSesInfo * static struct cifsSesInfo *
cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
{ {
...@@ -1928,6 +1930,15 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) ...@@ -1928,6 +1930,15 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
} }
ses->cred_uid = volume_info->cred_uid; ses->cred_uid = volume_info->cred_uid;
ses->linux_uid = volume_info->linux_uid; ses->linux_uid = volume_info->linux_uid;
/* ntlmv2 is much stronger than ntlm security, and has been broadly
supported for many years, time to update default security mechanism */
if ((volume_info->secFlg == 0) && warned_on_ntlm == false) {
warned_on_ntlm = true;
cERROR(1, "default security mechanism requested. The default "
"security mechanism will be upgraded from ntlm to "
"ntlmv2 in kernel release 2.6.41");
}
ses->overrideSecFlg = volume_info->secFlg; ses->overrideSecFlg = volume_info->secFlg;
mutex_lock(&ses->session_mutex); mutex_lock(&ses->session_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment