]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jun 2022 07:10:01 +0000 (09:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jun 2022 07:10:01 +0000 (09:10 +0200)
added patches:
cifs-return-errors-during-session-setup-during-reconnects.patch

queue-4.9/cifs-return-errors-during-session-setup-during-reconnects.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/cifs-return-errors-during-session-setup-during-reconnects.patch b/queue-4.9/cifs-return-errors-during-session-setup-during-reconnects.patch
new file mode 100644 (file)
index 0000000..e397f5a
--- /dev/null
@@ -0,0 +1,37 @@
+From 8ea21823aa584b55ba4b861307093b78054b0c1b Mon Sep 17 00:00:00 2001
+From: Shyam Prasad N <sprasad@microsoft.com>
+Date: Tue, 31 May 2022 12:31:05 +0000
+Subject: cifs: return errors during session setup during reconnects
+
+From: Shyam Prasad N <sprasad@microsoft.com>
+
+commit 8ea21823aa584b55ba4b861307093b78054b0c1b upstream.
+
+During reconnects, we check the return value from
+cifs_negotiate_protocol, and have handlers for both success
+and failures. But if that passes, and cifs_setup_session
+returns any errors other than -EACCES, we do not handle
+that. This fix adds a handler for that, so that we don't
+go ahead and try a tree_connect on a failed session.
+
+Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
+Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
+Cc: stable@vger.kernel.org
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/smb2pdu.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -265,6 +265,9 @@ smb2_reconnect(__le16 smb2_command, stru
+                       rc = -EHOSTDOWN;
+                       mutex_unlock(&tcon->ses->session_mutex);
+                       goto failed;
++              } else if (rc) {
++                      mutex_unlock(&ses->session_mutex);
++                      goto out;
+               }
+       }
+       if (rc || !tcon->need_reconnect) {
index a259f4340917c888b74759bb640410bbb3311483..51a2aea6051fcde019b1649fff7b322e2ce12a07 100644 (file)
@@ -157,3 +157,4 @@ modpost-fix-undefined-behavior-of-is_arm_mapping_sym.patch
 nodemask-fix-return-values-to-be-unsigned.patch
 vringh-fix-loop-descriptors-check-in-the-indirect-ca.patch
 alsa-hda-conexant-fix-loopback-issue-with-cx20632.patch
+cifs-return-errors-during-session-setup-during-reconnects.patch