Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1071097ybl; Wed, 14 Aug 2019 10:13:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzt7wcgVHZNmJ2xrPfCCFERDb4nr30CXcT58Q2XTyUyMIKzGoFk4fjIwC3WPaJu47AF8ak2 X-Received: by 2002:aa7:8746:: with SMTP id g6mr934102pfo.191.1565802823224; Wed, 14 Aug 2019 10:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802823; cv=none; d=google.com; s=arc-20160816; b=ZxU4rWW1PdGYfrbBj3LRMipaVD9bcASVJVtnuQqJwyD0Tw5sTevoTNvPvDCx/gaCqI jn/SBUDiVB0/IY+q8vGwWpKdS3e88aK18G1DJ4qqLyA/6M+tRRd1oRFPy6WkjcSd+ANh 7bczIUJChkm/PCuiYSw+FUnPz3FlScPOIBZto3ZTNVNYy3aZY8nMDxhIoOLcXrgAWkZs XwCK8fImiQqHS5st10fCELjiRsO/eaHKModawgsbkHLULrN3KoY0zthuIF+C0+J/FUpp bF+s0qxPvdcpIe1LmG5qKHE5+H1o5/bL4MDKgT5/zdi85lOuLsqsOLNIvrN1XFZOrLhM JJjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=74xtUK9uP82Xxq4qMe+5emyQVZH0rwflhC2nLP/gF5E=; b=ROrPMt3ow+cMwY3qy3M8mcI5YiKl7TLoWqGXIkiyd+PHT2fd1Z5i8ngl4nXjc/nNtD PlqJ90467YwpPElzLtSUC5SZN/WQfsVXxZcQxpV1Kfht33Zmj/8RzZ33QhySu4TIU35A Li7zwwAzTzUoFcw9sKXjYNelCMTUt2Sz13S4SutpikagoxLiU+ceQeqT1dnSAjelcOJa MAUv5PaGDb8IW4Uy6EUWh7gjzzbDqGr2KMd5uu9SVLkx7sZKqp9XcPOv0DAarNQk5q/Y qkBqtgS6dyi/V30qQHkMVuXsLQkUR0LxZvU6PUAvIUQZMN7gf8iy0pX2sZ4brM9gQurG wLwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oP1TvyCM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si58953pfc.239.2019.08.14.10.13.27; Wed, 14 Aug 2019 10:13:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oP1TvyCM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730627AbfHNRLm (ORCPT + 99 others); Wed, 14 Aug 2019 13:11:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:35110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730604AbfHNRLk (ORCPT ); Wed, 14 Aug 2019 13:11:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3A162063F; Wed, 14 Aug 2019 17:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802700; bh=WRLxgu5pjGZz8vXoOs3/zQIOrHQH6Ij/EdXN46H2njE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oP1TvyCMzkyfH21YwX8bXu/5pDHZZR6OlWlE4sDcUiRPO8fIAnRdBuZ5QSddf948+ CYIFBDxBUkSdIgJSx511lsMS99vPc8FktWG7Cx0NQfvCh5kVflY+I2hyw1a1qlDolY 9Hw/+E5FwEpvZRRpssJOwxLplGHCRybREe3X8yYM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Shilovsky , Steve French , Ronnie Sahlberg Subject: [PATCH 4.19 83/91] SMB3: Fix deadlock in validate negotiate hits reconnect Date: Wed, 14 Aug 2019 19:01:46 +0200 Message-Id: <20190814165753.556737990@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Shilovsky 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 Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg CC: Stable Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -168,7 +168,7 @@ smb2_reconnect(__le16 smb2_command, stru 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) {