[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHkRjk5ymBPHhw=k+3LZ+qbkHcJsW79LSUTvt-1Pi7iRNvqhCw@mail.gmail.com>
Date: Wed, 15 Jul 2015 17:43:00 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Andrey Vagin <avagin@...nvz.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jens Axboe <axboe@...com>,
Arianna Avanzini <avanzini.arianna@...il.com>
Subject: Re: [PATCH] blk-cgroup: don't leak blkcg->pd elements
I haven't checked the patch correctness but just noticed that the
block maintainer and author of the fixed commit are not cc'ed.
Catalin
On 15 July 2015 at 16:52, Andrey Vagin <avagin@...nvz.org> wrote:
> They are allocated in blkcg_css_alloc().
>
> This bug is reported by the kmemleak subsystem:
> unreferenced object 0xffff88007d004d60 (size 32):
> comm "systemd", pid 1, jiffies 4294668449 (age 34.455s)
> hex dump (first 32 bytes):
> 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 00 00 00 00 00 00 00 00 f4 01 00 00 f4 01 00 00 ................
> backtrace:
> [<ffffffff816ce9ce>] kmemleak_alloc+0x4e/0xb0
> [<ffffffff811baf94>] __kmalloc+0x1e4/0x290
> [<ffffffff8133eb5d>] blkcg_css_alloc+0x6d/0x120
> [<ffffffff81108124>] create_css+0x44/0x220
> [<ffffffff8110bcf0>] cgroup_mkdir+0x220/0x2c0
> [<ffffffff812513fa>] kernfs_iop_mkdir+0x5a/0x80
> [<ffffffff811dfddb>] vfs_mkdir+0xbb/0x150
> [<ffffffff811e50ea>] SyS_mkdir+0x7a/0xe0
> [<ffffffff816d822e>] entry_SYSCALL_64_fastpath+0x12/0x71
> [<ffffffffffffffff>] 0xffffffffffffffff
>
> Fixes: e48453c386f3 ('block, cgroup: implement policy-specific per-blkcg data')
> Signed-off-by: Andrey Vagin <avagin@...nvz.org>
> ---
> block/blk-cgroup.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 9f97da5..aa04821 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -821,6 +821,10 @@ static void blkcg_css_offline(struct cgroup_subsys_state *css)
> static void blkcg_css_free(struct cgroup_subsys_state *css)
> {
> struct blkcg *blkcg = css_to_blkcg(css);
> + int i;
> +
> + for (i = 0; i < BLKCG_MAX_POLS ; i++)
> + kfree(blkcg->pd[i]);
>
> if (blkcg != &blkcg_root)
> kfree(blkcg);
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists