From patchwork Thu Aug 1 14:02:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2837045 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 3A4C1C0319 for ; Thu, 1 Aug 2013 14:03:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98A8C202F8 for ; Thu, 1 Aug 2013 14:03:46 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B5AA2026F for ; Thu, 1 Aug 2013 14:03:45 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r71E3XE9023231 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Aug 2013 14:03:33 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 r71E3VqE024382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Aug 2013 14:03:32 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V4tTX-0008Gq-Ti; Thu, 01 Aug 2013 07:03:31 -0700 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V4tTC-0008FZ-18 for ocfs2-devel@oss.oracle.com; Thu, 01 Aug 2013 07:03:10 -0700 Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r71E39Pw004670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Aug 2013 14:03:09 GMT Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r71E39kV022940; Thu, 1 Aug 2013 14:03:09 GMT Received: from elgon.mountain (/41.202.233.190) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Aug 2013 07:03:08 -0700 Date: Thu, 1 Aug 2013 17:02:59 +0300 From: Dan Carpenter To: Mark Fasheh , Jie Liu , David Weber Message-ID: <20130801140259.GA18952@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130801135830.GA5102@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [patch v2] 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. In fact, the memset isn't needed because the initializer will set all these values to zero. Signed-off-by: Dan Carpenter --- v2: remove the memset diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index c91d986..b1748cd 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -2157,9 +2157,6 @@ int ocfs2_empty_dir(struct inode *inode) .ctx.pos = 0, }; - memset(&priv + sizeof(struct dir_context), 0, - sizeof(priv) - sizeof(struct dir_context)); - if (ocfs2_dir_indexed(inode)) { ret = ocfs2_empty_dir_dx(inode, &priv); if (ret)