Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3429611imu; Sun, 11 Nov 2018 14:55:28 -0800 (PST) X-Google-Smtp-Source: AJdET5d3cSv4ZoNxucFGKGjPQ2gCl21pCSeC0xGmtMAN60l86oSbetsWfcQuAfjySYVYJluapsCa X-Received: by 2002:a17:902:b217:: with SMTP id t23-v6mr5680663plr.128.1541976928000; Sun, 11 Nov 2018 14:55:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541976927; cv=none; d=google.com; s=arc-20160816; b=hTlgzuPFwDSrd0GqFWIU+3HeLbG4S1ppeLCdUDpzotg67ThZk451BtK3fLAjNahM4y OPXj5DBfNErxOzWSxRmzGSE/5/QE16C3X5IP6tJstfbHZmVTM7PDPNQugti9HzUErHp8 XJ7L0psj66/DHCrRcwXOL3cmOqpn0RhTavAwwntLrSxWM0Ckokv4s5tIJRgdPUIIPGV+ i3vuOZ3H+Ymk/SlniLJNqPv8Wsss8CIimwXi3jrEkYvrk3Iu57OqafAYycBe9B4rWFuN l2lCX7AncpdwmksWyfOSCU/c1SI7krujtK+BRzgGHNBVptPLl0ON5nbCVUlHWdYKHsU2 ekCg== 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=aebU11awHWqO2uGLxLL5LE/fOIMiyFtKc2H2j7P6AQw=; b=EH6RntDehdx7Bp0z0GIBk1/J2SLwBT2zaPOPPqaMXbovOMpo9CAqR7nMkOVxGTrjBa xkaC/0BksgdIXlIWmbttB962oYy3nsbnAEn9OyKvQptiXW5uc/JNhyYKyRK68Ep8D1g5 fdxM3/KlgdnuDu8UwjsH1ItLRwWyPbr2X0K4nzaLENFeIhvuDoFZTAhFnRbjHDJv42Sk pSpLajA4nVY8mBb+1JKILssyUMVAbR9xYdmiJvq13KfkGgi434KOqdWQyOqRU0Gk9oaJ W8UZMBHRi5EIFSSWVMEvYlDdwfwemWCuAYo6ov1Ih7PZS92zGw8WgiiJFdMzcXOTbNnA 3pXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SxRUpfVL; 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 k135-v6si16309904pfd.239.2018.11.11.14.55.13; Sun, 11 Nov 2018 14:55:27 -0800 (PST) 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=SxRUpfVL; 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 S2390936AbeKLIox (ORCPT + 99 others); Mon, 12 Nov 2018 03:44:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:54642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403957AbeKLIWz (ORCPT ); Mon, 12 Nov 2018 03:22:55 -0500 Received: from localhost (unknown [206.108.79.134]) (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 7C01E2243E; Sun, 11 Nov 2018 22:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975578; bh=jg4TiyXPc+avwJee7TaniUp+Ic+kZyR4qZ4TmcDV9UA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SxRUpfVLuGvwNqkRHu6oc/Ht3XngnP+tuEZAtyqTpAqUF9VXuKrOCgSvN9z66Yy// EzumS0JmomKgw6fOk20w9Khzi4nV58isdRnw9qiJDI3BmcC0BkZEv4ZKUIcW/RE+PQ IGZnZhE7Udp3AfGdi/wspAqbSmLJpSqnKqd+IE6I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve French , Ronnie Sahlberg Subject: [PATCH 4.14 165/222] smb3: do not attempt cifs operation in smb3 query info error path Date: Sun, 11 Nov 2018 14:24:22 -0800 Message-Id: <20181111221702.018404509@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steve French commit 1e77a8c204c9d1b655c61751b8ad0fde22421dbb upstream. If backupuid mount option is sent, we can incorrectly retry (on access denied on query info) with a cifs (FindFirst) operation on an smb3 mount which causes the server to force the session close. We set backup intent on open so no need for this fallback. See kernel bugzilla 201435 Signed-off-by: Steve French CC: Stable Reviewed-by: Ronnie Sahlberg Signed-off-by: Greg Kroah-Hartman --- fs/cifs/inode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -776,7 +776,15 @@ cifs_get_inode_info(struct inode **inode } else if (rc == -EREMOTE) { cifs_create_dfs_fattr(&fattr, sb); rc = 0; - } else if (rc == -EACCES && backup_cred(cifs_sb)) { + } else if ((rc == -EACCES) && backup_cred(cifs_sb) && + (strcmp(server->vals->version_string, SMB1_VERSION_STRING) + == 0)) { + /* + * For SMB2 and later the backup intent flag is already + * sent if needed on open and there is no path based + * FindFirst operation to use to retry with + */ + srchinf = kzalloc(sizeof(struct cifs_search_info), GFP_KERNEL); if (srchinf == NULL) {