From patchwork Tue Jul 21 14:58:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 6836881 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 460A99F38B for ; Tue, 21 Jul 2015 14:59:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DBE52060D for ; Tue, 21 Jul 2015 14:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98CE92052D for ; Tue, 21 Jul 2015 14:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755602AbbGUO6v (ORCPT ); Tue, 21 Jul 2015 10:58:51 -0400 Received: from forward-corp1f.mail.yandex.net ([95.108.130.40]:43886 "EHLO forward-corp1f.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754636AbbGUO6t (ORCPT ); Tue, 21 Jul 2015 10:58:49 -0400 Received: from smtpcorp4.mail.yandex.net (smtpcorp4.mail.yandex.net [95.108.252.2]) by forward-corp1f.mail.yandex.net (Yandex) with ESMTP id 481D32420A2B; Tue, 21 Jul 2015 17:58:45 +0300 (MSK) Received: from smtpcorp4.mail.yandex.net (localhost [127.0.0.1]) by smtpcorp4.mail.yandex.net (Yandex) with ESMTP id 011A22C0310; Tue, 21 Jul 2015 17:58:45 +0300 (MSK) Received: from unknown (unknown [2a02:6b8:0:408:2499:8588:6604:38e4]) by smtpcorp4.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8Lj3IJhNr2-wi9au3ZY; Tue, 21 Jul 2015 17:58:44 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1437490724; bh=NkBjzNzFs6uPEFrbCVeR8VSXnBDpLdO7PWM1P65tQxQ=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VuG9BQSRrq8EQSbg4fV3wrFuVFxnSgkTOMvCoGTX9zTh0PMsoiWHlml0bDIh8RNj2 lH1GXBk4xvzBUt9rBImrlPJ9F9Ws173XjqC5jbhtZOWw9l8ZJV2ymoLU4qsRYv46T9 D8yr/arHIwHtKQdXCbJnH9Qa8b1g0DAA4CREfSyQ= Authentication-Results: smtpcorp4.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Subject: [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super From: Konstantin Khlebnikov To: linux-unionfs@vger.kernel.org, Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Tue, 21 Jul 2015 17:58:44 +0300 Message-ID: <20150721145844.11975.16773.stgit@buzz> In-Reply-To: <20150721145843.11975.3849.stgit@buzz> References: <20150721145843.11975.3849.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 This fixes memory leak after umount. Kmemleak report: unreferenced object 0xffff8800ba791010 (size 8): comm "mount", pid 2394, jiffies 4294996294 (age 53.920s) hex dump (first 8 bytes): 20 1c 13 02 00 88 ff ff ....... backtrace: [] create_object+0x124/0x2c0 [] kmemleak_alloc+0x7b/0xc0 [] __kmalloc+0x106/0x340 [] ovl_fill_super+0x55c/0x9b0 [overlay] [] mount_nodev+0x54/0xa0 [] ovl_mount+0x18/0x20 [overlay] [] mount_fs+0x43/0x170 [] vfs_kern_mount+0x74/0x170 [] do_mount+0x22d/0xdf0 [] SyS_mount+0x7b/0xc0 [] entry_SYSCALL_64_fastpath+0x12/0x76 [] 0xffffffffffffffff Signed-off-by: Konstantin Khlebnikov Fixes: dd662667e6d3 ("ovl: add mutli-layer infrastructure") --- fs/overlayfs/super.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index ea9b1c20d48f..afcf825c384c 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -544,6 +544,7 @@ static void ovl_put_super(struct super_block *sb) mntput(ufs->upper_mnt); for (i = 0; i < ufs->numlower; i++) mntput(ufs->lower_mnt[i]); + kfree(ufs->lower_mnt); kfree(ufs->config.lowerdir); kfree(ufs->config.upperdir);