summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilov@microsoft.com>2019-07-22 11:34:59 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-16 10:11:10 +0200
commit37ba1062b2692199110c7c84fcb722fcb9add691 (patch)
tree8ed41ea19d6a92fef4c3d99a319d41f12c0d2c89 /fs/cifs
parent7ad905c1587dbdf29409972f1b3669408c4bb847 (diff)
downloadlinux-stable-37ba1062b2692199110c7c84fcb722fcb9add691.tar.gz
linux-stable-37ba1062b2692199110c7c84fcb722fcb9add691.tar.bz2
linux-stable-37ba1062b2692199110c7c84fcb722fcb9add691.zip
SMB3: Fix deadlock in validate negotiate hits reconnect
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>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2pdu.c2
1 files changed, 1 insertions, 1 deletions
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) {