Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1026077yba; Thu, 4 Apr 2019 02:43:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxv8dU2s+IO56cuJ+SixI62USuCUn0s99ePgNY4UPuPY4QXNG+sNnzyCxwdU8+IZbnmiK31 X-Received: by 2002:a63:6e0e:: with SMTP id j14mr4756725pgc.203.1554371003729; Thu, 04 Apr 2019 02:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371003; cv=none; d=google.com; s=arc-20160816; b=ghqKcznMkLP7DNemlJou0Bv8OwaSg4E0RC2cCB53jGUsIgK5RVw6kyQQt+0QPCOX+M sQXofAuVGL+cJGZsSA+FN8omieBKM9UldX4dqpVFuhTr17qat2Gw4qAJCfKgxcpgpogH aGG6ibtIRkGL7TPoqs3/M9OkvKwwQ+qY7sBwpNvTC/kQTZgTAdG5gLFN782/VcYilMaG nPk7BAOtaLGk8Hv5m1nNn1PYDDqRGo/0ukD9VmBufswRsO3SUUn/Ze78ScUzE4zAteCT RMX/Xn9wfHlAegvBOXS4BD4/c/yYsTe/bDNSoR7u1SbVdP3M3ROgrQy57GD9U0N1hmdY FlxQ== 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=OoBoUnmlYWywP+jLWSxuGd5DzWB4IJVm2KfT6X8DodM=; b=widozWg6b1jFM6R/+0MFQes4i1O78Na7mJ4MPsyNVbPN8rYB/pM2TybzxtlDMJBqHG zDis8j+J/XNsfV8DNwbOIi4wu4y+AWtKOHNnHlGlcGnCiq8x4H6hg1VwXy0mRRh4/kIP MufPa7kDmMD8AR+jlTnvot6Hn5eskIQksrLO0PeqQWDljPHQ5xN5tncc4khQkXYlSdjw P3frjMkGVkx7UXN1M9eQG5idf31iXKK0wdT4RqE8uCaq1zEJb1rLpEtn5cfUIWAxhFFF hx/g1wi4V0CtggHQBTuqrxvHhd43XdbIFTKanhncSJjKlgMA2a7yAQc1oKiEPEzx13Gd J09A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UUiE4CaC; 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 w7si9893937plp.341.2019.04.04.02.43.08; Thu, 04 Apr 2019 02:43:23 -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=UUiE4CaC; 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 S1731453AbfDDJmf (ORCPT + 99 others); Thu, 4 Apr 2019 05:42:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730482AbfDDJBU (ORCPT ); Thu, 4 Apr 2019 05:01:20 -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 DB81721741; Thu, 4 Apr 2019 09:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368480; bh=XcFrHLG3c2mR/DNZwpCrOvZNlQ5NA+MgCR6kU81BqPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUiE4CaCv3HgJtpH+QKVIlbWxmo1sVmhUl2t2VhjHNflfv9v0uuk7CY27EvBCJ/Gk YgPPVFxoER3yTl47zOe8katsi1rBaa+Mc++sfmyhgAe6n2f2InMgN5hiZD11PRUOv9 djLDQnU7EMn3b+C1+iCaUOKok0LGaPXYtleG48sA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Namjae Jeon , Steve French , Sasha Levin Subject: [PATCH 4.19 039/187] cifs: Accept validate negotiate if server return NT_STATUS_NOT_SUPPORTED Date: Thu, 4 Apr 2019 10:46:16 +0200 Message-Id: <20190404084604.918847946@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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. ------------------ [ 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 3d0db37d64ad..71f32d983384 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -881,8 +881,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