stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ovl: free stack of paths in ovl_fill_super
@ 2015-07-21 14:58 Konstantin Khlebnikov
  2015-07-21 14:58 ` [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super Konstantin Khlebnikov
  2015-07-21 15:27 ` [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Konstantin Khlebnikov @ 2015-07-21 14:58 UTC (permalink / raw)
  To: linux-unionfs, Miklos Szeredi; +Cc: linux-fsdevel, linux-kernel, stable

This fixes small memory leak after each successful mount.
Kmemleak report:

unreferenced object 0xffff88003683fe00 (size 16):
  comm "mount", pid 2029, jiffies 4294909563 (age 33.380s)
  hex dump (first 16 bytes):
    20 27 1f bb 00 88 ff ff 40 4b 0f 36 02 88 ff ff   '......@K.6....
  backtrace:
    [<ffffffff811f8cd4>] create_object+0x124/0x2c0
    [<ffffffff817a059b>] kmemleak_alloc+0x7b/0xc0
    [<ffffffff811dffe6>] __kmalloc+0x106/0x340
    [<ffffffffa01b7a29>] ovl_fill_super+0x389/0x9a0 [overlay]
    [<ffffffff81200ac4>] mount_nodev+0x54/0xa0
    [<ffffffffa01b7118>] ovl_mount+0x18/0x20 [overlay]
    [<ffffffff81201ab3>] mount_fs+0x43/0x170
    [<ffffffff81220d34>] vfs_kern_mount+0x74/0x170
    [<ffffffff812233ad>] do_mount+0x22d/0xdf0
    [<ffffffff812242cb>] SyS_mount+0x7b/0xc0
    [<ffffffff817b6bee>] entry_SYSCALL_64_fastpath+0x12/0x76
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: a78d9f0d5d5c ("ovl: support multiple lower layers")
---
 fs/overlayfs/super.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index a27572894eb1..ea9b1c20d48f 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1049,6 +1049,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
 		oe->lowerstack[i].dentry = stack[i].dentry;
 		oe->lowerstack[i].mnt = ufs->lower_mnt[i];
 	}
+	kfree(stack);
 
 	root_dentry->d_fsdata = oe;
 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super
  2015-07-21 14:58 [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Konstantin Khlebnikov
@ 2015-07-21 14:58 ` Konstantin Khlebnikov
  2015-07-21 15:27   ` Greg KH
  2015-07-21 15:27 ` [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Greg KH
  1 sibling, 1 reply; 4+ messages in thread
From: Konstantin Khlebnikov @ 2015-07-21 14:58 UTC (permalink / raw)
  To: linux-unionfs, Miklos Szeredi; +Cc: linux-fsdevel, linux-kernel, stable

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:
    [<ffffffff811f8cd4>] create_object+0x124/0x2c0
    [<ffffffff817a059b>] kmemleak_alloc+0x7b/0xc0
    [<ffffffff811dffe6>] __kmalloc+0x106/0x340
    [<ffffffffa0152bfc>] ovl_fill_super+0x55c/0x9b0 [overlay]
    [<ffffffff81200ac4>] mount_nodev+0x54/0xa0
    [<ffffffffa0152118>] ovl_mount+0x18/0x20 [overlay]
    [<ffffffff81201ab3>] mount_fs+0x43/0x170
    [<ffffffff81220d34>] vfs_kern_mount+0x74/0x170
    [<ffffffff812233ad>] do_mount+0x22d/0xdf0
    [<ffffffff812242cb>] SyS_mount+0x7b/0xc0
    [<ffffffff817b6bee>] entry_SYSCALL_64_fastpath+0x12/0x76
    [<ffffffffffffffff>] 0xffffffffffffffff

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: dd662667e6d3 ("ovl: add mutli-layer infrastructure")
---
 fs/overlayfs/super.c |    1 +
 1 file changed, 1 insertion(+)

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);


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ovl: free stack of paths in ovl_fill_super
  2015-07-21 14:58 [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Konstantin Khlebnikov
  2015-07-21 14:58 ` [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super Konstantin Khlebnikov
@ 2015-07-21 15:27 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-07-21 15:27 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-unionfs, Miklos Szeredi, linux-fsdevel, linux-kernel,
	stable

On Tue, Jul 21, 2015 at 05:58:43PM +0300, Konstantin Khlebnikov wrote:
> This fixes small memory leak after each successful mount.
> Kmemleak report:
> 
> unreferenced object 0xffff88003683fe00 (size 16):
>   comm "mount", pid 2029, jiffies 4294909563 (age 33.380s)
>   hex dump (first 16 bytes):
>     20 27 1f bb 00 88 ff ff 40 4b 0f 36 02 88 ff ff   '......@K.6....
>   backtrace:
>     [<ffffffff811f8cd4>] create_object+0x124/0x2c0
>     [<ffffffff817a059b>] kmemleak_alloc+0x7b/0xc0
>     [<ffffffff811dffe6>] __kmalloc+0x106/0x340
>     [<ffffffffa01b7a29>] ovl_fill_super+0x389/0x9a0 [overlay]
>     [<ffffffff81200ac4>] mount_nodev+0x54/0xa0
>     [<ffffffffa01b7118>] ovl_mount+0x18/0x20 [overlay]
>     [<ffffffff81201ab3>] mount_fs+0x43/0x170
>     [<ffffffff81220d34>] vfs_kern_mount+0x74/0x170
>     [<ffffffff812233ad>] do_mount+0x22d/0xdf0
>     [<ffffffff812242cb>] SyS_mount+0x7b/0xc0
>     [<ffffffff817b6bee>] entry_SYSCALL_64_fastpath+0x12/0x76
>     [<ffffffffffffffff>] 0xffffffffffffffff
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: a78d9f0d5d5c ("ovl: support multiple lower layers")
> ---
>  fs/overlayfs/super.c |    1 +
>  1 file changed, 1 insertion(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super
  2015-07-21 14:58 ` [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super Konstantin Khlebnikov
@ 2015-07-21 15:27   ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-07-21 15:27 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-unionfs, Miklos Szeredi, linux-fsdevel, linux-kernel,
	stable

On Tue, Jul 21, 2015 at 05:58:44PM +0300, Konstantin Khlebnikov wrote:
> 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:
>     [<ffffffff811f8cd4>] create_object+0x124/0x2c0
>     [<ffffffff817a059b>] kmemleak_alloc+0x7b/0xc0
>     [<ffffffff811dffe6>] __kmalloc+0x106/0x340
>     [<ffffffffa0152bfc>] ovl_fill_super+0x55c/0x9b0 [overlay]
>     [<ffffffff81200ac4>] mount_nodev+0x54/0xa0
>     [<ffffffffa0152118>] ovl_mount+0x18/0x20 [overlay]
>     [<ffffffff81201ab3>] mount_fs+0x43/0x170
>     [<ffffffff81220d34>] vfs_kern_mount+0x74/0x170
>     [<ffffffff812233ad>] do_mount+0x22d/0xdf0
>     [<ffffffff812242cb>] SyS_mount+0x7b/0xc0
>     [<ffffffff817b6bee>] entry_SYSCALL_64_fastpath+0x12/0x76
>     [<ffffffffffffffff>] 0xffffffffffffffff
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: dd662667e6d3 ("ovl: add mutli-layer infrastructure")
> ---
>  fs/overlayfs/super.c |    1 +
>  1 file changed, 1 insertion(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-21 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21 14:58 [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Konstantin Khlebnikov
2015-07-21 14:58 ` [PATCH 2/2] ovl: free lower_mnt array in ovl_put_super Konstantin Khlebnikov
2015-07-21 15:27   ` Greg KH
2015-07-21 15:27 ` [PATCH 1/2] ovl: free stack of paths in ovl_fill_super Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).