From patchwork Fri Mar 28 21:44:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Eeda X-Patchwork-Id: 3907601 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 10D5EBF540 for ; Fri, 28 Mar 2014 21:46:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE2E62034C for ; Fri, 28 Mar 2014 21:46:14 +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 CA78920222 for ; Fri, 28 Mar 2014 21:46:13 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s2SLjY6V004477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Mar 2014 21:45:35 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 s2SLjXVf021723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Mar 2014 21:45:33 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WTeaj-0007bI-Jq; Fri, 28 Mar 2014 14:45:33 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WTeaD-0007Zo-ES for ocfs2-devel@oss.oracle.com; Fri, 28 Mar 2014 14:45:01 -0700 Received: from ca-server1.us.oracle.com (ca-server1.us.oracle.com [139.185.48.5]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2SLj0pR020518; Fri, 28 Mar 2014 21:45:01 GMT Received: from seeda by ca-server1.us.oracle.com with local (Exim 4.69) (envelope-from ) id 1WTeaC-0001xS-3o; Fri, 28 Mar 2014 14:45:00 -0700 From: Srinivas Eeda To: akpm@linux-foundation.org Date: Fri, 28 Mar 2014 14:44:57 -0700 Message-Id: <1396043097-7192-2-git-send-email-srinivas.eeda@oracle.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1396043097-7192-1-git-send-email-srinivas.eeda@oracle.com> References: <1396043097-7192-1-git-send-email-srinivas.eeda@oracle.com> Cc: penguin-kernel@I-love.SAKURA.ne.jp, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2: Fix panic on kfree(xattr->name) 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: , MIME-Version: 1.0 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=-4.6 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 From: Tetsuo Handa Commit 9548906b 'xattr: Constify ->name member of "struct xattr".' missed that ocfs2 is calling kfree(xattr->name). As a result, kernel panic occurs upon calling kfree(xattr->name) because xattr->name refers static constant names. This patch removes kfree(xattr->name) from ocfs2_mknod() and ocfs2_symlink(). Reported-by: Tariq Saeed Signed-off-by: Tetsuo Handa Reviewed-by: Srinivas Eeda --- fs/ocfs2/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 3683643..feed025f 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -450,7 +450,6 @@ leave: brelse(new_fe_bh); brelse(parent_fe_bh); - kfree(si.name); kfree(si.value); ocfs2_free_dir_lookup_result(&lookup); @@ -1855,7 +1854,6 @@ bail: brelse(new_fe_bh); brelse(parent_fe_bh); - kfree(si.name); kfree(si.value); ocfs2_free_dir_lookup_result(&lookup); if (inode_ac)