Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1083448ybl; Wed, 14 Aug 2019 10:25:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhpCIuXuCw4o8cOS85jf3aBqGS2e8IxD79EaWeGDObClh7k5cZz8nWHvx230MG+wFA/Nth X-Received: by 2002:a17:90a:b884:: with SMTP id o4mr804785pjr.52.1565803533493; Wed, 14 Aug 2019 10:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803533; cv=none; d=google.com; s=arc-20160816; b=DAEnEz5AH8+lX9jyjfSIAkcyoHcrvYLhz/JTJcZDnVcE7fIrRBamXRYW5XkiHYUrVc n+x1s8jumXAA1Q2R8/xPaxQJv5t5n9BnYV3ixkTBBe9ku2D06wrsQenZAKlNgApx8PNG lChwbi3q2vQjyuAOvicFFVvA1wD5Xlrq/ojDV5auGPk0Xz7CQh27p6+gEpNhqX/bfWML qQZ4QUujBE07TQsA3C/SGlyefOM2sOQqi6PakzexBgWk4P0UMgRTcenfnmyDIeHQlj39 s8Pa1m76/cHoCB9u1I5sx4ierHSFYRRRI2WlFLAbQzSdOVSX2stjh4Syjj9l960WUvOR MDaQ== 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=Bn4ZmKAcwccNh8JPIPZqR4UjIGsDXuF1puZHixhXdk0=; b=MFkf8np1b3aKE2eCOegmhlcENCTYyiKf5z/HrnTJ5MXoaCOnPZZ/j3rF6mIxc11L6k i9nyJyzO80/RKa2S/HFVJpYnRcb7atIwH6VUsuOccz1N7J4tcvozbuT9zysEAT1r7RHk BQ4UUw8fRH4bgYwhqLt9ipYUQgT/qfcAxEuM/8vyHapsnr8lzpCwBUhSpfP34lT2HiM3 IXKF5ZwdDMltdSdlOSW3ZhgJJ+I/PMEHRLVTnUh2jUMpEvLMrwHlKx4DBVgB+YVIZ7vv u4sk2RUG7S2z0P+NnxUPa4waLy2p/Di5XsJBQBts03GcfMnxP3XL2S8mpbUM5Iw6+2+m Nj6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PmBz0MWf; 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 c127si90579pfa.20.2019.08.14.10.25.18; Wed, 14 Aug 2019 10:25:33 -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=PmBz0MWf; 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 S1729919AbfHNRHe (ORCPT + 99 others); Wed, 14 Aug 2019 13:07:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:57088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729908AbfHNRHd (ORCPT ); Wed, 14 Aug 2019 13:07:33 -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 CFBC22173E; Wed, 14 Aug 2019 17:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802452; bh=jMyeCtktxhV+Xfv7v5B4WquZh1FtInWv73NaMpzUvNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmBz0MWfpC3gVhXwk6SF6pDq+10QNnJTZy0qfmdNCHwwtoL67cqk3dKHlKKFFvHpc nTxYch0FKztiHfiqfAbOX5uNpH/99TO7fLdGW7yfHcTtrJzyGoaC3z1WJTVbXRruVY 874CoadxuhCiO4T9SQk9XV762L6xjOp1K8iKFGwU= 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 5.2 132/144] SMB3: Fix deadlock in validate negotiate hits reconnect Date: Wed, 14 Aug 2019 19:01:28 +0200 Message-Id: <20190814165805.467965486@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@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 @@ -252,7 +252,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) {