From patchwork Tue Dec 4 23:12:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1839741 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B055B3FCA5 for ; Tue, 4 Dec 2012 23:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751444Ab2LDXMN (ORCPT ); Tue, 4 Dec 2012 18:12:13 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:38971 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751913Ab2LDXMN (ORCPT ); Tue, 4 Dec 2012 18:12:13 -0500 Received: by mail-qa0-f53.google.com with SMTP id a19so1247531qad.19 for ; Tue, 04 Dec 2012 15:12:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ViG5NJDTelJ/zkExGTgZi1d14PRoq/Mu6gxS/zbqG/s=; b=Ic7liFrQAXvpTa8EZNQYOQWQBgLPe40qekIC19Hls5d9tnFa7NKkieLUvPTqEXd95t w1wE9+/WUzyTIx0H6S42pqFIHI2qW0phL0QIQZ+AHebULB1ZNDIJCjZs6lEnih540Pp7 x4u2gpgylrNNYoKojZvPLHj+omGYhlhN34OlX+xfz2v7OI8388GjQg+lh0k3febYg8xx sYih3QBqzsMHORssieRQR2f3di8CE9tCNH1h9lXZ9NrP3uShxQYVwIuDYFay8O/MIr62 KdS2BipOiKthGXFDoER6ZeRwdyoNBgb/SRodyilCt/L38siwxm10BDHxiG11sC3/43xg aHKg== MIME-Version: 1.0 Received: by 10.224.173.207 with SMTP id q15mr25212803qaz.69.1354662732417; Tue, 04 Dec 2012 15:12:12 -0800 (PST) Received: by 10.49.73.170 with HTTP; Tue, 4 Dec 2012 15:12:12 -0800 (PST) Date: Tue, 4 Dec 2012 17:12:12 -0600 Message-ID: Subject: [PATCH] [CIFS] SMB3 mounts fail with access denied to some servers From: Steve French To: linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Author: Steve French Date: Tue Dec 4 16:56:37 2012 -0600 [CIFS] SMB3 mounts fail with access denied to some servers We were checking incorrectly if signatures were required to be sent, so were always sending signatures after the initial session establishment. For SMB3 mounts (vers=3.0) this was a problem because we were putting SMB2 signatures in SMB3 requests which would cause access denied on mount (the tree connection would fail). Signed-off-by: Steve French Reviewed-by: Jeff Layton diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index cf33622..e7f9dbc 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -425,7 +425,7 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) } cFYI(1, "sec_flags 0x%x", sec_flags); - if (sec_flags & CIFSSEC_MUST_SIGN) { + if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { cFYI(1, "Signing required"); if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED | SMB2_NEGOTIATE_SIGNING_ENABLED))) {