Received: by 10.223.185.116 with SMTP id b49csp2386776wrg; Thu, 15 Feb 2018 10:49:49 -0800 (PST) X-Google-Smtp-Source: AH8x225K9f0aawKjYt3vksuDpajWpA241tKWCxuykjyOcajA60yqOQklzLNhI8YyQWgAH+5q7o3A X-Received: by 2002:a17:902:2f03:: with SMTP id s3-v6mr3478906plb.112.1518720589374; Thu, 15 Feb 2018 10:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518720589; cv=none; d=google.com; s=arc-20160816; b=xjweIYtLlaUzJbKJ13DLg/ylPFXnyiV6buUrz14TeWdBZzgCLhx7YucKG+roKCNOiP owYiHVO4v1Rmktg+GlZcw6lT4isjLYZuIrEOPDk2Bl22zp0W29f6cIcjtnLRqv1d5IKs s9eiWnWWlB3zqLIZSbzKGByYvSwAveMH73cm4k7mwPVvxGoufaTipp59HE5KAqgWLL06 ntHEY2C3K7Cy5O7+f9tj7v/lZ4T+bUJRiykPuhtZ1Qss1QdCHtm5SDLq+xEKM3iSn88H J2MYFW02IxGt0yuhgNoTTNOIhyj2uf+vxifKP47TKLGQpJ7Ihc0V5CBBbBF0GwRzxvuO IuGA== 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=nyuKq6xklvsZsqYXP/wA6Y5I/BB6xKfOueonHWnMTrg=; b=sKgGzuBjMo1CLoBDX6OBqX2Gl+WHn35gL5GrUi3TAFORgwjkGxV3VRuEhH9KujRSKf 29zjjPLOdLSKPbEofUjj0mX456fBHqvfMcGuV2LPhkYMyjpLy9FqvuQWuN+vj2pULZ1m fuTBZ+kl7E9wAz7OVC4578+L/Z+ZYfz6FSKo+bMrbq64QHiJwTK5HNHiCVQAFEu2MGkT b78fTHMN0+X68yPDM1S3jS3Bhmds5iKueONc0NlPdAGH4aaCoUPcQ+/lwo0ZWhRJFGXw +GTQtMHFtY54Ky8hcACHFLqdEohqf+g8HC1WP2PEA+15vE8MDSTS9WZLAMCcLZDyeOvp xOHA== 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 z7si7770374pgv.473.2018.02.15.10.49.34; Thu, 15 Feb 2018 10:49:49 -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 S1166851AbeBOSr2 (ORCPT + 99 others); Thu, 15 Feb 2018 13:47:28 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49490 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162358AbeBOPWS (ORCPT ); Thu, 15 Feb 2018 10:22:18 -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 B763AE06; Thu, 15 Feb 2018 15:22:17 +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.4 041/108] cifs: Fix autonegotiate security settings mismatch Date: Thu, 15 Feb 2018 16:16:38 +0100 Message-Id: <20180215151228.157301627@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@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.4-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 @@ -580,8 +580,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))