From patchwork Tue Jan 22 00:46:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namjae Jeon X-Patchwork-Id: 10774751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60F836C2 for ; Tue, 22 Jan 2019 00:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 508FF29A04 for ; Tue, 22 Jan 2019 00:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4388629A40; Tue, 22 Jan 2019 00:48:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CCB129A04 for ; Tue, 22 Jan 2019 00:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725991AbfAVAsv (ORCPT ); Mon, 21 Jan 2019 19:48:51 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:57269 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725896AbfAVAsv (ORCPT ); Mon, 21 Jan 2019 19:48:51 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190122004848epoutp02282746de8fb47541eb593a0b0f7d763a~8BTxcuABx2129121291epoutp02B for ; Tue, 22 Jan 2019 00:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190122004848epoutp02282746de8fb47541eb593a0b0f7d763a~8BTxcuABx2129121291epoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1548118128; bh=Ff/fnh237Y9OtzgqBecAGZ4kaU7R3wn5ltKj6BFSKDg=; h=From:To:Cc:Subject:Date:References:From; b=IFSPZri46qnRvAsIJ+VnBjOqDdietUN8GBVy7pIf0c7A8kvYfNj7OAopqx+ptX+pu 66Ao8Qa/whuf3wdVKhymO6fDg3h1IlVJTYPQtBY1dQKLRHoER/L0SsHpmyHYqjlx4d FoqdR2t5Kv51zYNTYVC0BRrvXNSdCEtFJt6vm3+E= Received: from epsmges1p4.samsung.com (unknown [182.195.42.56]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20190122004848epcas1p40108aa70fec014339a093db4b0ec0619~8BTw-bafy0102001020epcas1p4C; Tue, 22 Jan 2019 00:48:48 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id 7F.50.04288.078664C5; Tue, 22 Jan 2019 09:48:48 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20190122004847epcas1p4d9455c59e48d44676ebda07c798c2bf5~8BTwuJiYE1366213662epcas1p4S; Tue, 22 Jan 2019 00:48:47 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190122004847epsmtrp2fc60c857e3d4aca878aa84dd2b7f2c38~8BTwtP_oW0083700837epsmtrp2y; Tue, 22 Jan 2019 00:48:47 +0000 (GMT) X-AuditID: b6c32a38-c0fff700000010c0-5d-5c46687057cd Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id DC.59.03601.F68664C5; Tue, 22 Jan 2019 09:48:47 +0900 (KST) Received: from localhost.localdomain (unknown [10.88.103.87]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190122004847epsmtip22cf701062c72b8a5c5d5ed02d6ddc220~8BTwix-jy0633606336epsmtip2Z; Tue, 22 Jan 2019 00:48:47 +0000 (GMT) From: Namjae Jeon To: smfrench@gmail.com, linux-cifs@vger.kernel.org Cc: namjae.jeon@samsung.com, Namjae Jeon Subject: [PATCH] cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED Date: Tue, 22 Jan 2019 09:46:45 +0900 Message-Id: <1548118005-18670-1-git-send-email-linkinjeon@gmail.com> X-Mailer: git-send-email 2.7.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKIsWRmVeSWpSXmKPExsWy7bCmvm5BhluMQfsZLovrd28xW7z4v4vZ 4sf0eos3Lw6zObB47Jx1l92jb8sqRo/Pm+QCmKO4bFJSczLLUov07RK4Mr4uucNU8IKrYv7H 6gbG3xxdjJwcEgImEg2PFjN3MXJxCAnsYJS4fPEQK4TziVFiXtd/FgjnG6PEmqeH2WBavq18 AZXYyyix7+t0JriWu5dvsoBUsQloSCw8f5kdxBYRMJLYPHU/M4jNLGAvcWfuYjBbWCBa4tjm c0wgNouAqkT3jsdgNq+Ai8S7yx+htslJtPzYDXaThMBdVolr7w8xQyRcJB7vXQtVJCzx6vgW dghbSuLzu71AcQ6gZZoS63fpQ+zlk3j3tYcVJCwhwCvR0SYEUa0q0XfpMBOELS3R1f6BHaLE Q+LiRW8QU0ggVmLXweQJjJKzEEYuYGRcxSiWWlCcm55abFhgolecmFtcmpeul5yfu4kRHFla FjsY95zzOcQowMGoxMPLcc41Rog1say4MvcQowQHs5IIr5i2W4wQb0piZVVqUX58UWlOavEh RmkOFiVx3vUOzjFCAumJJanZqakFqUUwWSYOTqkGRrlpwse3em0RPTFLxZCpNKrwgHFSwoJD mzfN2BY6W6XXxt95i85rXbeX/lvntigVfT2hd+h199LqlyGCpU4z0wxSP+UKxcla7Z9ocuvM 35NPkvhldrEku0+3Oif7ykhyqfxL/SU6p/msVRIiOWTDeldYnu1fz7GsjiV9T1Su+MkV3b8l rD42KrEUZyQaajEXFScCALM4+4SoAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLJMWRmVeSWpSXmKPExsWy7bCSvG5+hluMwYR7JhbX795itnjxfxez xY/p9RZvXhxmc2Dx2DnrLrtH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVwZXxdcoep4AVXxfyP 1Q2Mvzm6GDk5JARMJL6tfMECYgsJ7GaUOLs/HCIuLXHsxBnmLkYOIFtY4vDh4i5GLqCSD4wS V28cZgOpYRPQkFh4/jI7SI0I0JyLjUkgJrOAo8SuA2EgFcICkRKT568Hq2YRUJXo3vGYCcTm FXCReHf5IxvEJjmJlh+7WScw8ixgZFjFKJlaUJybnltsWGCUl1quV5yYW1yal66XnJ+7iREc CFpaOxhPnIg/xCjAwajEw5twwTVGiDWxrLgy9xCjBAezkgivmLZbjBBvSmJlVWpRfnxRaU5q 8SFGaQ4WJXFe+fxjkUIC6YklqdmpqQWpRTBZJg5OqQbGNjOXCC7VhuncLI/8d+1m1DBk3JKV Nb/GznPRF49pv4SeB68J1xE16/8/zdt7kZ23Q5pD0tXl5gtm290vbi5/IV/yhaUjrWuLc+6l mRwuGySys3ffvrp8xk/ZO7bTnI8frXebuPz94dRaxoaiA/+XSPHazf2SFfTwqaVbRf2EK+Wl 0YefOSYpsRRnJBpqMRcVJwIAQDXfOQACAAA= X-CMS-MailID: 20190122004847epcas1p4d9455c59e48d44676ebda07c798c2bf5 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20190122004847epcas1p4d9455c59e48d44676ebda07c798c2bf5 References: Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/ Samba client had already handled it. https://bugzilla.samba.org/attachment.cgi?id=13285&action=edit Signed-off-by: Namjae Jeon --- 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 0af87bd..c9e6def 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, "Accept validate negotiate: not supported error\n"); + return 0; + } else if (rc != 0) { cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc); rc = -EIO; goto out_free_inbuf;