From patchwork Thu Aug 1 13:55:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2837038 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A0E3BC0319 for ; Thu, 1 Aug 2013 13:56:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 89B4520316 for ; Thu, 1 Aug 2013 13:56:07 +0000 (UTC) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B92892030B for ; Thu, 1 Aug 2013 13:56:02 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r71DtmGL010619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Aug 2013 13:55:49 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r71DtiOv028854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Aug 2013 13:55:44 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V4tM0-0007kR-Ep; Thu, 01 Aug 2013 06:55:44 -0700 Received: from ucsinet22.oracle.com ([156.151.31.94]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V4tLt-0007k9-L2 for ocfs2-devel@oss.oracle.com; Thu, 01 Aug 2013 06:55:37 -0700 Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r71DtaFY011157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Aug 2013 13:55:36 GMT Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r71Dtaou011737; Thu, 1 Aug 2013 13:55:36 GMT Received: from elgon.mountain (/41.202.233.190) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Aug 2013 06:55:35 -0700 Date: Thu, 1 Aug 2013 16:55:26 +0300 From: Dan Carpenter To: Mark Fasheh , Jie Liu , David Weber Message-ID: <20130801135526.GA17153@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [patch] ocfs2: fix recent memory corruption bug X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pointer math in 6fdf3af1d2 "ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id()" isn't correct so it will zero out the wrong memory. Signed-off-by: Dan Carpenter --- Static checker stuff. diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index c91d986..6942c22 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -2157,8 +2157,7 @@ int ocfs2_empty_dir(struct inode *inode) .ctx.pos = 0, }; - memset(&priv + sizeof(struct dir_context), 0, - sizeof(priv) - sizeof(struct dir_context)); + memset(&priv.seen_dot, 0, sizeof(priv) - sizeof(struct dir_context)); if (ocfs2_dir_indexed(inode)) { ret = ocfs2_empty_dir_dx(inode, &priv);