Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:11 +0200
commit50e54b4b1027c0faefca9a0865b038b900d3c80d (patch)
treec0f89cd86bc513ff4d6285d20a338d2e8ed95da7
parent12fea4a49ff81cc81d2153a55ae7537b3563a238 (diff)
SMB3: Fix deadlock in validate negotiate hits reconnect
-rw-r--r--patches.kernel.org/5.2.9-132-SMB3-Fix-deadlock-in-validate-negotiate-hits-re.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-132-SMB3-Fix-deadlock-in-validate-negotiate-hits-re.patch b/patches.kernel.org/5.2.9-132-SMB3-Fix-deadlock-in-validate-negotiate-hits-re.patch
new file mode 100644
index 0000000000..3a56228937
--- /dev/null
+++ b/patches.kernel.org/5.2.9-132-SMB3-Fix-deadlock-in-validate-negotiate-hits-re.patch
@@ -0,0 +1,43 @@
+From: Pavel Shilovsky <pshilov@microsoft.com>
+Date: Mon, 22 Jul 2019 11:34:59 -0700
+Subject: [PATCH] SMB3: Fix deadlock in validate negotiate hits reconnect
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: e99c63e4d86d3a94818693147b469fa70de6f945
+
+commit e99c63e4d86d3a94818693147b469fa70de6f945 upstream.
+
+Currently we skip SMB2_TREE_CONNECT command when checking during
+reconnect because Tree Connect happens when establishing
+an SMB session. For SMB 3.0 protocol version the code also calls
+validate negotiate which results in SMB2_IOCL command being sent
+over the wire. This may deadlock on trying to acquire a mutex when
+checking for reconnect. Fix this by skipping SMB2_IOCL command
+when doing the reconnect check.
+
+Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
+CC: Stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ fs/cifs/smb2pdu.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
+index 75311a8a68bf..ee8b1452ddbc 100644
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -252,7 +252,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
+ if (tcon == NULL)
+ return 0;
+
+- if (smb2_command == SMB2_TREE_CONNECT)
++ if (smb2_command == SMB2_TREE_CONNECT || smb2_command == SMB2_IOCTL)
+ return 0;
+
+ if (tcon->tidStatus == CifsExiting) {
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index ac4545eb29..d4204ac0b2 100644
--- a/series.conf
+++ b/series.conf
@@ -1152,6 +1152,7 @@
patches.kernel.org/5.2.9-129-ALSA-hda-Workaround-for-crackled-sound-on-AMD-c.patch
patches.kernel.org/5.2.9-130-mac80211-don-t-WARN-on-short-WMM-parameters-fro.patch
patches.kernel.org/5.2.9-131-dax-dax_layout_busy_page-should-not-unmap-cow-p.patch
+ patches.kernel.org/5.2.9-132-SMB3-Fix-deadlock-in-validate-negotiate-hits-re.patch
########################################################
# Build fixes that apply to the vanilla kernel too.