blob: 346b5667aacdb9aa1d57d7d1ae3f58933bcdff55 [file] [log] [blame]
From 9d4105aeba2fc0e33099668334589dd997cc89aa Mon Sep 17 00:00:00 2001
From: Steve French <>
Date: Thu, 16 Jul 2020 00:34:21 -0500
Subject: [PATCH] smb3: warn on confusing error scenario with sec=krb5
commit 0a018944eee913962bce8ffebbb121960d5125d9 upstream.
When mounting with Kerberos, users have been confused about the
default error returned in scenarios in which either keyutils is
not installed or the user did not properly acquire a krb5 ticket.
Log a warning message in the case that "ENOKEY" is returned
from the get_spnego_key upcall so that users can better understand
why mount failed in those two cases.
CC: Stable <>
Signed-off-by: Steve French <>
Signed-off-by: Paul Gortmaker <>
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index bfc8a7d38a8b..78f4cd690dc2 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1298,6 +1298,8 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
spnego_key = cifs_get_spnego_key(ses);
if (IS_ERR(spnego_key)) {
rc = PTR_ERR(spnego_key);
+ if (rc == -ENOKEY)
+ cifs_dbg(VFS, "Verify user has a krb5 ticket and keyutils is installed\n");
spnego_key = NULL;
goto out;