From patchwork Wed Jun 16 13:38:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 55885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id A8EBCB7D48 for ; Wed, 16 Jun 2010 23:38:24 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 422DCAD28D; Wed, 16 Jun 2010 07:38:23 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.8 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.123]) by lists.samba.org (Postfix) with ESMTP id 58E97ACF29 for ; Wed, 16 Jun 2010 07:38:13 -0600 (MDT) X-Authority-Analysis: v=1.0 c=1 a=Jp3FLXNZjnYA:10 a=1CvaPgNKC-EA:10 a=VwQbUJbxAAAA:8 a=20KFwNOVAAAA:8 a=bLuJxl-RQ-TlGXr6j1EA:9 a=9RoJ-bONTd95PFfIMR8A:7 a=C-3tUpg-kvVG3jP7p3kE9fnJn34A:4 a=LI9Vle30uBYA:10 a=jEp0ucaQiEUA:10 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:43749] helo=mail.poochiereds.net) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id FE/F6-25132-5C3D81C4; Wed, 16 Jun 2010 13:38:14 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 859C9580E2; Wed, 16 Jun 2010 09:38:13 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Date: Wed, 16 Jun 2010 09:38:13 -0400 Message-Id: <1276695493-6340-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.6.1 Cc: linux-cifs-client@lists.samba.org, gdeschner@redhat.com, linux-cifs@vger.kernel.org Subject: [linux-cifs-client] [PATCH] cifs: remove bogus first_time check in NTLMv2 session setup code X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org This bug appears to be the result of a cut-and-paste mistake from the NTLMv1 code. The function to generate the MAC key was commented out, but not the conditional above it. The conditional then ended up causing the session setup key not to be copied to the buffer unless this was the first session on the socket, and that made all but the first NTLMv2 session setup fail. Fix this by removing the conditional and all of the commented clutter that made it difficult to see. Cc: Stable Reported-by: Gunther Deschner Signed-off-by: Jeff Layton --- fs/cifs/sess.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 7707389..0a57cb7 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -730,15 +730,7 @@ ssetup_ntlmssp_authenticate: /* calculate session key */ setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp); - if (first_time) /* should this be moved into common code - with similar ntlmv2 path? */ - /* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key, - response BB FIXME, v2_sess_key); */ - - /* copy session key */ - - /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE); - bcc_ptr += LM2_SESS_KEY_SIZE; */ + /* FIXME: calculate MAC key */ memcpy(bcc_ptr, (char *)v2_sess_key, sizeof(struct ntlmv2_resp)); bcc_ptr += sizeof(struct ntlmv2_resp);