Received: by 10.223.185.116 with SMTP id b49csp2551192wrg; Thu, 15 Feb 2018 13:29:19 -0800 (PST) X-Google-Smtp-Source: AH8x227z5dtdMvByqWnEijrSuESWZpc1fe3nsiqSroMyCUyniX9jUw0F/13PVAMQgVpmi8ikEwbG X-Received: by 10.98.10.199 with SMTP id 68mr319438pfk.202.1518730159777; Thu, 15 Feb 2018 13:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518730159; cv=none; d=google.com; s=arc-20160816; b=UXFpCFQL+ZU9GQymnIjZjYa+6nVVSJC9S9nkScDUPmInAUkZTSSIB5PrwQSOtQ4jxg MuJZpuKeAPY0SGaOdnUgC5BbfKo50BHZo1ylMc1yeOEgRsS6o051zcwzkLaMDlsvrXyl bhb7o7zvmh4EyUHAFjM3CZu5Ttv7WWVuBdHfICrxbVRGASFJ7zQuX+jz5oM64+WHRXGM eDk94AB/SS4i+YZUav4cjoHjI+afStMM7GPxHsE9P/vJpgcEF+IJ660bIwXmATMHIg3A pmqLjQ2TgM46CdpQnzQ+9IBqpHAJa3Ye6XjlysD05zo8owwhtseV1/lpG/1cqXyEmCrn K3Qg== 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=mJ+zxyCcP591WvfHaFRTZacIjTgsfQlTpZu0Gm7GSNM=; b=e4GoxPFJbIwvOmLxBqFAlYuU9InxLxkvtGyJHrOxSyCC52C3oIA55lL2eYT+/1snNu /i8psEeqsnzbkDEiajB/JPy1Ds69fqn5mH4gXkIbvYkXl0ZuFqOe/68Cyu21Ar9FbocI 3TAZvuAijdawM+MF2vmyt6pR5RvFnmBhNT5Jo7R0bB8umVxGQ0wXvKieQ0ak+EbOB4hP OLRwKXwZE1yW3W929qyDAy57JmhoTIsdmCOn59mbtfs7XfriAiRJFVUDg9tuotZsw8HI XmG6X5I23hVnSANh+FA+eB8JL93wAc4cso7NP8rO0asRcnYV0fHpX3Zp4lJFhnxn9kra rZJg== 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 r11-v6si2173788plo.624.2018.02.15.13.29.04; Thu, 15 Feb 2018 13:29:19 -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 S1163332AbeBOP0K (ORCPT + 99 others); Thu, 15 Feb 2018 10:26:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52528 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163314AbeBOP0G (ORCPT ); Thu, 15 Feb 2018 10:26:06 -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 C64CB111D; Thu, 15 Feb 2018 15:26:05 +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.9 03/88] cifs: Fix autonegotiate security settings mismatch Date: Thu, 15 Feb 2018 16:16:30 +0100 Message-Id: <20180215151222.947185375@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.437136975@linuxfoundation.org> References: <20180215151222.437136975@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.9-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 @@ -585,8 +585,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))