Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3473918imu; Sun, 11 Nov 2018 15:56:14 -0800 (PST) X-Google-Smtp-Source: AJdET5fT+5wOWz7LlNZZGMzxuzD6aYCafK4ePRaVaq7ENkgZ/8omnKOIYLhEA+eCDhZI7v6unHNU X-Received: by 2002:a17:902:7088:: with SMTP id z8-v6mr343921plk.329.1541980574131; Sun, 11 Nov 2018 15:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980574; cv=none; d=google.com; s=arc-20160816; b=j2UBaArY/4ef9xfqw+FhCNVDc0kwcOBg1J3MazHOTqWrDULJvLxRgFbuhCnvbAj2J6 WON0RUtMZvFWpw1PUiwdK74IGsM0OWt2hi+LZRlLnzUCYrnwVi90cMxouxGc115HgIwT wXDBBJpiLtmdVMAM4eI2mcqpg3Rw1vKy7TbTMXKlWwbMalSIJmTrFsMnZ1FPc3kJ/5xD Yo26r8TqBxE9uYi+eL+W0FFovMZ7i7/7eayW2LgvnTy+elcv7fcTfDM7byjNjaBnTUQw kOZyuFeVLX2gSyrXwlqZ5sAVyQ+Oo4JAttfwLJEexzYZvPkPJP3QIUGKvQSv5hR2YlWo aGcQ== 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=E8IEHKWRQXaUKhf7NRITboVC5TQhid+vmvWQazY8+Ig=; b=KFx4q74gi6qxxLCnUpI73kx52tfM68lcl5faVEFndlu6RBND9e/A5cWHHD/I69VzE9 E3CoA89zG86uVdgYK8fXnIWZJnDjYpRT8XgHfp9VKZB17mCLndh0k+tZ7M4ypyCkNVw8 4jMaHzGWJBloHL7n0ghfIT/Loh44K5f45+kCMFwNwlR+t5Vr1i+UZaTtYH/jxPAPmlyj wNod3BTrd+0fTVREZRyTsRi98IrsZEVLWSfrUiJO5WWJqf0nv8JbAOFTFu0+CEryRGcv 9OHoL62jERo2WOp0cI3m9KA23CkV87H0e6J4WIrq+6VYEdWUSrt5u2L6rTNFHrmIqXAu 3/ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JbB62RjU; 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 t4si14180555pga.83.2018.11.11.15.55.58; Sun, 11 Nov 2018 15:56:14 -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=JbB62RjU; 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 S1732894AbeKLJqB (ORCPT + 99 others); Mon, 12 Nov 2018 04:46:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:35336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732634AbeKLISR (ORCPT ); Mon, 12 Nov 2018 03:18:17 -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 9AA60216FD; Sun, 11 Nov 2018 22:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975301; bh=w+RO1OFGQqsNRsfa8ikIKOFBR7WYbgKsNLRmA9H6uGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JbB62RjUtswKjoP3B3qJu4GBoDHlKPpiy6rbkiuHhfXuf2Y7ZxkmBPLpAt+9ua2PP 8VA0gDY31tomncDNgWCsAH/0oC1iC3f2+h6PGJd5b7UhTMIo2orHRRpSq7DRGCde1+ BAOEpbkI29wQFYd26DcZC35TvQd2YOxNrnw59Aqg= 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.19 264/361] smb3: do not attempt cifs operation in smb3 query info error path Date: Sun, 11 Nov 2018 14:20:11 -0800 Message-Id: <20181111221654.491683340@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@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.19-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 @@ -777,7 +777,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) {