From patchwork Tue Sep 25 07:00:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 1502431 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3BE1FDF28C for ; Tue, 25 Sep 2012 07:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138Ab2IYHAY (ORCPT ); Tue, 25 Sep 2012 03:00:24 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:42925 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097Ab2IYHAY (ORCPT ); Tue, 25 Sep 2012 03:00:24 -0400 Received: by lbbgj3 with SMTP id gj3so7872849lbb.19 for ; Tue, 25 Sep 2012 00:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=8quir8/EUYJvmeicBygVv9F06KOXksZxgzEMDi35A6s=; b=MaATQKsrUvmUo8gPYghk7WBr9+oCixQ0QOai0elusR/erV6h5oxOJMRJFpKlLTTPAQ Ba/vwKcqRmFXJV47vE05f4xsD/Zq4g7pdLTmD40hKCJpQDdBqDLWlUYbJ7+URzfH5xba JmWZuvhTk4HWVADd5URNH1JbTIs9kdwZkmfY44tURplGK578xzIOqd0nDoNn2/A9bgXI 8hmB8F7aKzrOQcKTJEBoQnJsiQpeY70TFMM9usNBEAXnEh0pAgVw+LkA/hIDnRRw9bgd ZteGTJFgYoz9ohICUgyei2pdX1FyT/IxRMUgqm4XrwVKCwzm8kEdP/5DylsBl7weKszQ lZPQ== Received: by 10.112.38.163 with SMTP id h3mr5225701lbk.130.1348556423000; Tue, 25 Sep 2012 00:00:23 -0700 (PDT) Received: from localhost.localdomain ([178.45.141.120]) by mx.google.com with ESMTPS id p7sm4800417lbg.17.2012.09.25.00.00.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 00:00:22 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH] CIFS: Fix possible freed pointer dereference in CIFS_SessSetup Date: Tue, 25 Sep 2012 11:00:08 +0400 Message-Id: <1348556409-10339-2-git-send-email-piastry@etersoft.ru> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348556409-10339-1-git-send-email-piastry@etersoft.ru> References: <1348556409-10339-1-git-send-email-piastry@etersoft.ru> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Pavel Shilovsky --- fs/cifs/sess.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 382c06d..76809f4 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -876,7 +876,8 @@ ssetup_ntlmssp_authenticate: pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base; smb_buf = (struct smb_hdr *)iov[0].iov_base; - if ((type == RawNTLMSSP) && (smb_buf->Status.CifsError == + if ((type == RawNTLMSSP) && (resp_buf_type != CIFS_NO_BUFFER) && + (smb_buf->Status.CifsError == cpu_to_le32(NT_STATUS_MORE_PROCESSING_REQUIRED))) { if (phase != NtLmNegotiate) { cERROR(1, "Unexpected more processing error");