Received: by 10.223.185.116 with SMTP id b49csp2271406wrg; Thu, 15 Feb 2018 09:04:36 -0800 (PST) X-Google-Smtp-Source: AH8x225KCwlqoZ1wJ1ruJDhbIOQdJWT8ZrqsTrVWlltjbB3MBjLYIWTwK+QJXtpm76Bo4pluhYCr X-Received: by 10.101.68.202 with SMTP id g10mr2829632pgs.210.1518714276199; Thu, 15 Feb 2018 09:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518714276; cv=none; d=google.com; s=arc-20160816; b=pVd2AUkNe6t5UKMh1DvMaBxCdheCIQllsBWxnmqYDs6mirnCsCqGeSZX8xKihWcahb tXsAbIQosvqsOcDFVgMACVc0agZuxY8wmzZz4U74Uz/rZf0eiREiKZ0pIlwZF/OHwtrP ByT4rsu4ea+Rw36MgCkR0oVd1WzZbjjSmM0znEOrcyJ+CppiZp/bzD2iJ/0HmurF4XAN mUHVED+EIdTVXi+cn6/Dd5y2qDHobtPEbrMpLYNUYY+BwrMAWcN+Ngsi2z+fXTO8atXG SHf3nyZwMDMDvnT8OP2YaV7Zxn5kGoiixOpddujE1afPoL/raWs834F4x6iO8OLOAtNv vf/Q== 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=BY71XvquEoktSWa2ao/rJ2hxIYsbYVXGwbujXbhwR7I=; b=dGXwNuNW7PNkI8x21w+njp4823LBZolp2/ZYDRJ/9NjsIjRD/a2lu0paTNeRgKicjF HoJC6DBzoXuhGuAh7kdWfGuFzlIbgSbknXfIL7KsaE1/qYNGTHVTHZYK1WtmPfXOmTyo Pv+lc8+wH4hLtBboV4zaLcGhu9+E/AwCtVqtX06yl2GXF50lvtLXsuAcwgl1uUcdO21+ dp6x6bkUq8Z8pz0V+zw9Kee9/NrjDdDqgeHce2xzxBKtZmML8sxZq3SACg9YlV2CAllZ rvVMaNQZ6hiW9w8I3L4b/E801dYUNFUWMgDsfX/ToGSenIMDlEswFRLKSrRjXLNrC1gD 7+2g== 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 w8-v6si1335066plk.597.2018.02.15.09.04.09; Thu, 15 Feb 2018 09:04:36 -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 S1423444AbeBOPjB (ORCPT + 99 others); Thu, 15 Feb 2018 10:39:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423435AbeBOPi7 (ORCPT ); Thu, 15 Feb 2018 10:38:59 -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 8AF7010CB; Thu, 15 Feb 2018 15:38:58 +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.15 003/202] cifs: Fix autonegotiate security settings mismatch Date: Thu, 15 Feb 2018 16:15:03 +0100 Message-Id: <20180215151712.942943437@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@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.15-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))