Received: by 10.223.185.116 with SMTP id b49csp2339782wrg; Thu, 15 Feb 2018 10:04:32 -0800 (PST) X-Google-Smtp-Source: AH8x226+qZjs4kUHOJgFaV8yvKiE/fUcukEXxy2eDNeKey+Wdd8dbzbAbrhni8XWeL4wQ32+uimc X-Received: by 10.98.26.143 with SMTP id a137mr3468524pfa.100.1518717871990; Thu, 15 Feb 2018 10:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518717871; cv=none; d=google.com; s=arc-20160816; b=YDfgpVWpSC8ITbdyuMzpRzVS/LL87Rb6T9fmR6NHF4DfNzKja78mgbBrVtB99BumAs Fm71XWil54qp1yjUiAxUFAfqT2uh0ZAVUi40nadxf89OkvgHy13npS5YTdEZQYq+dKcu JvfABVazD30XE6vmxemysRgRheEb5W+TiDRgcoRPiYQ4SXj8WQS3IvclNEXxFYm+QG09 1SjxIWeuyMlflenqRcx8Z1bWCKjcBq3lexpR8EWBsDa1KzYQve8AKkFn1uztk41z2k3m SMDVxlFo1tnzXUbXk0CBSlZ52H/9jbIQai9tv5zZfe3AmSAMFtSw4M1lC1fGDUIciXTZ lGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pl4OIndYzyqIOzX5nxiqJedXeZpYF3pAr1sAnBNefZE=; b=nBr6ZJ4N+ATwiwg9W+Fs/Fr49MiqYfd14gVsXLFSQSEWb8F2w+duQWlFshjRjkHt72 8eKTt6XWc65vyPOPMZdaW6bXaPs7qS25f1+9RjbzYGK+7ihQpAbHDnwrNbqqNh3PUG0p 4uRJQ5JG+BCtIqzYMD6MfSLiEwx3zzvCekiNkod+Zhx33RntCTwUK4IxkD01kq+at19S 5eEwlUDz5gXBVXXSpjyKPJINdhr97k2phz6kFzsQEVJUDHI0MKdn/DxUmg/AmKRMdHaZ dAmQa7tBgKIADJu/voO6rFdelg0g4QPHmIkeC5Beh9MR4Q0uN5C53hKyvpa8q8IxajEE mZig== ARC-Authentication-Results: i=1; mx.google.com; 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 x18si491923pfm.270.2018.02.15.10.04.15; Thu, 15 Feb 2018 10:04:31 -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; 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 S1164149AbeBOPaC (ORCPT + 99 others); Thu, 15 Feb 2018 10:30:02 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54874 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164122AbeBOP36 (ORCPT ); Thu, 15 Feb 2018 10:29:58 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ED6B6111D; Thu, 15 Feb 2018 15:29:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel N Pettersson , Steve French Subject: [PATCH 4.14 004/195] cifs: Fix autonegotiate security settings mismatch Date: Thu, 15 Feb 2018 16:14:55 +0100 Message-Id: <20180215151705.961429909@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Daniel N Pettersson commit 9aca7e454415f7878b28524e76bebe1170911a88 upstream. Autonegotiation gives a security settings mismatch error if the SMB server selects an SMBv3 dialect that isn't SMB3.02. The exact error is "protocol revalidation - security settings mismatch". This can be tested using Samba v4.2 or by setting the global Samba setting max protocol = SMB3_00. The check that fails in smb3_validate_negotiate is the dialect verification of the negotiate info response. This is because it tries to verify against the protocol_id in the global smbdefault_values. The protocol_id in smbdefault_values is SMB3.02. In SMB2_negotiate the protocol_id in smbdefault_values isn't updated, it is global so it probably shouldn't be, but server->dialect is. This patch changes the check in smb3_validate_negotiate to use server->dialect instead of server->vals->protocol_id. The patch works with autonegotiate and when using a specific version in the vers mount option. Signed-off-by: Daniel N Pettersson Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2pdu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -733,8 +733,7 @@ int smb3_validate_negotiate(const unsign } /* check validate negotiate info response matches what we got earlier */ - if (pneg_rsp->Dialect != - cpu_to_le16(tcon->ses->server->vals->protocol_id)) + if (pneg_rsp->Dialect != cpu_to_le16(tcon->ses->server->dialect)) goto vneg_out; if (pneg_rsp->SecurityMode != cpu_to_le16(tcon->ses->server->sec_mode))