From patchwork Thu Jul 31 03:26:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damian Hobson-Garcia X-Patchwork-Id: 4652991 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D27FB9F3FF for ; Thu, 31 Jul 2014 03:27:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 071A72015E for ; Thu, 31 Jul 2014 03:27:46 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 530F2201BB for ; Thu, 31 Jul 2014 03:27:44 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 29D63927; Thu, 31 Jul 2014 03:27:10 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D2F7DA6D for ; Thu, 31 Jul 2014 03:27:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3C1041FB59 for ; Thu, 31 Jul 2014 03:27:08 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id w10so2648907pde.9 for ; Wed, 30 Jul 2014 20:27:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Q8dwwhWGK2NoVIK1UenYao+3ikjFebuMpaBcg84RK4M=; b=ZoPXlRL8ROSxwlO0+4jypdTxo9GrMWkTdfn8EsLux9B3hf2X4QR7YWudSmW86fMfYm NylUaLe14epBx5s0/7Ksnd1YZul75k1sHmJ/AyjCNPOJgNGjAyH15rHOGIy8MLebZ1Jf ppfaOW9KD3DOLf237l4b6+WQePnm8OrWJjZsv6BBZ2Ty9lpw8vPTVn+TzbQ7zh8VTJ3G a/ikEKz0OjKGN2oUfzFEIZIMMOsXJO8YOEHjlCiZpXTW0UPObbNrtLyZtdIoNctjgaqo RnK9tc8UpJHkM30H44Tz8Y6HqtEoxg/iWEvprxFRBuTg9Uh3OB+PJC/WAjyoUxTnQrpa Hjwg== X-Gm-Message-State: ALoCoQms0svorWkVOisaFwSGd08i1NTo113GRlBOtb4ovMe+ny8xCyHtY69u7hPe15eWjEkiVBVM X-Received: by 10.68.245.100 with SMTP id xn4mr476890pbc.152.1406777227970; Wed, 30 Jul 2014 20:27:07 -0700 (PDT) Received: from v400.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id d13sm3843861pbu.72.2014.07.30.20.27.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 20:27:07 -0700 (PDT) From: Damian Hobson-Garcia To: ltsi-dev@lists.linuxfoundation.org Date: Thu, 31 Jul 2014 12:26:42 +0900 Message-Id: <1406777210-28425-9-git-send-email-dhobsong@igel.co.jp> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406777210-28425-1-git-send-email-dhobsong@igel.co.jp> References: <1406777210-28425-1-git-send-email-dhobsong@igel.co.jp> X-Spam-Status: No, score=-4.9 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 Subject: [LTSI-dev] [PATCH 08/16] ocfs2: fix panic on kfree(xattr->name) X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tetsuo Handa Commit 9548906b2bb7 ('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(). Signed-off-by: Tetsuo Handa Reported-by: Tariq Saeed Tested-by: Tariq Saeed Reviewed-by: Srinivas Eeda Cc: Joel Becker Cc: Mark Fasheh Cc: [3.12+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit f81c20158f8d5f7938d5eb86ecc42ecc09273ce6) Signed-off-by: Damian Hobson-Garcia Signed-off-by: Tomohito Esaki --- fs/ocfs2/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index b4a5cdf..64bf0f4 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -430,7 +430,6 @@ leave: brelse(new_fe_bh); brelse(parent_fe_bh); - kfree(si.name); kfree(si.value); ocfs2_free_dir_lookup_result(&lookup); @@ -1817,7 +1816,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)