Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5654264img; Wed, 27 Mar 2019 12:31:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpHG8PE56v9rqQ/zLhoybwkEZ3I7yqUYgHakn+7a5uKqlRrlH6VDwU4Ej8eqbbymu3tuz4 X-Received: by 2002:aa7:83ca:: with SMTP id j10mr36763958pfn.50.1553715104591; Wed, 27 Mar 2019 12:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715104; cv=none; d=google.com; s=arc-20160816; b=ykIbOeNNHoTRgvuceRKVGGRls/wZeUXeS74fy0cDafPs9tp+IEkJgbHlK6FhjypHD4 bLDlpM+w4BuZ+PbnvIKH/C2GPg/DY4ke2VcsP/mRIWNcfS3iEyYOIcsdpbhOYuLDFFnn VnHIiNJioDhfy+m+6pY6jLhMhVZ3clUj1Gb2BKCyYnE+AsjkNK8sfOLAEdF08or5D1i6 hjher1STjTSSftKtjiTnb/Uvj0O6uR0kZzaXs4A+6OQ0odVv7ztM5lr/2IO+4IhnVZTk qWwyPLV+ZSLWv7QX/+EBxZeGD6lO/AekCkWQsJZOYfkCA6IpNEAX3QFc7w2P38dTtjfs IXVg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1USfU9l+6K0kp660xx4NP65Vmhy1zPpf9M2tZFp0h1s=; b=O7RYDDyMvT7uXj97H5q2bT5eZ6cICJDyDOh6BkXxyoBRlEsoVKiIua452rqsdwCg1u 4NPC2eCy7Pn810ItR6Fm2kMpl7IVl0l3xqtObhW0YxpZfmg7UhMpdtr/JyraV2GfsiRp fLyGgTlnEV1YmooKsydPM9gu/y7Y0aEHiUdIacQMayC4GAVC8JBRWY/SFu09gM+3txbj zZATMmMNHlMUZbjvoAodDeBIkJf8OphqMtP+OZyWssEYWSFpXt6ZI4Xm9RD+/ZdSu1Dl LW10jg9m9WCQoDXAIBeUMP7jIVkTMDnt9+vq7mmogR/MVmiCnmzA4UR5GkEyJLA2aZ49 a95w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dRevXqIP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si2980079pgq.4.2019.03.27.12.31.28; Wed, 27 Mar 2019 12:31:44 -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=dRevXqIP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbfC0Tan (ORCPT + 99 others); Wed, 27 Mar 2019 15:30:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732444AbfC0SD2 (ORCPT ); Wed, 27 Mar 2019 14:03:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7A042177E; Wed, 27 Mar 2019 18:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709807; bh=slGkVjFL3LpAiH1xQquQ8NgUeVdDJIVdqTTaX78/7NQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRevXqIPHPivG/l3WzusUwI9w7Lf3xBgE3UIHCT0um/MSW5St6PO6C9jwmqKeUdoE Mqisv9YqRZ8oCaJclqi5E7q/nLwecl/+wqcN9wv3YRO23s2DGPEe2AFofCqIJK0r7u OpinAlb0vyUxY6670N0JqOzM24yFH09UC90bP7A4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Namjae Jeon , Steve French , Sasha Levin , linux-cifs@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 049/262] cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED Date: Wed, 27 Mar 2019 13:58:24 -0400 Message-Id: <20190327180158.10245-49-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Namjae Jeon [ Upstream commit 969ae8e8d4ee54c99134d3895f2adf96047f5bee ] Old windows version or Netapp SMB server will return NT_STATUS_NOT_SUPPORTED since they do not allow or implement FSCTL_VALIDATE_NEGOTIATE_INFO. The client should accept the response provided it's properly signed. See https://blogs.msdn.microsoft.com/openspecification/2012/06/28/smb3-secure-dialect-negotiation/ and MS-SMB2 validate negotiate response processing: https://msdn.microsoft.com/en-us/library/hh880630.aspx Samba client had already handled it. https://bugzilla.samba.org/attachment.cgi?id=13285&action=edit Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2pdu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 77b3aaa39b35..4efeb2a02ea4 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -986,8 +986,14 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, (char *)pneg_inbuf, inbuflen, (char **)&pneg_rsp, &rsplen); - - if (rc != 0) { + if (rc == -EOPNOTSUPP) { + /* + * Old Windows versions or Netapp SMB server can return + * not supported error. Client should accept it. + */ + cifs_dbg(VFS, "Server does not support validate negotiate\n"); + return 0; + } else if (rc != 0) { cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); rc = -EIO; goto out_free_inbuf; -- 2.19.1