Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692929

Re: [PATCH] tracing: Fix kmemleak in instance_rmdir

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH] tracing: Fix kmemleak in instance_rmdir
Date 2017-07-20 15:30 +0200
Message-ID <u5jGG-81X-3@gated-at.bofh.it> (permalink)
References <u5h2a-63o-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 20 Jul 2017 18:36:09 +0800
Chunyu Hu <chuhu@redhat.com> wrote:

> Hit the kmemleak when executing instance_rmdir, it forgot releasing
> mem of tracing_cpumask. With this fix, the warn does not appear any
> more.

Thanks, applied!

-- Steve

> 
> unreferenced object 0xffff93a8dfaa7c18 (size 8):
>   comm "mkdir", pid 1436, jiffies 4294763622 (age 9134.308s)
>   hex dump (first 8 bytes):
>     ff ff ff ff ff ff ff ff                          ........
>   backtrace:
>     [<ffffffff88b6567a>] kmemleak_alloc+0x4a/0xa0
>     [<ffffffff8861ea41>] __kmalloc_node+0xf1/0x280
>     [<ffffffff88b505d3>] alloc_cpumask_var_node+0x23/0x30
>     [<ffffffff88b5060e>] alloc_cpumask_var+0xe/0x10
>     [<ffffffff88571ab0>] instance_mkdir+0x90/0x240
>     [<ffffffff886e5100>] tracefs_syscall_mkdir+0x40/0x70
>     [<ffffffff886565c9>] vfs_mkdir+0x109/0x1b0
>     [<ffffffff8865b1d0>] SyS_mkdir+0xd0/0x100
>     [<ffffffff88403857>] do_syscall_64+0x67/0x150
>     [<ffffffff88b710e7>] return_from_SYSCALL_64+0x0/0x6a
>     [<ffffffffffffffff>] 0xffffffffffffffff
> 
> Signed-off-by: Chunyu Hu <chuhu@redhat.com>
> ---
>  kernel/trace/trace.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 2d0ffcc..42b9355 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -7774,6 +7774,7 @@ static int instance_rmdir(const char *name)
>  	}
>  	kfree(tr->topts);
>  
> +	free_cpumask_var(tr->tracing_cpumask);
>  	kfree(tr->name);
>  	kfree(tr);
>  

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] tracing: Fix kmemleak in instance_rmdir Chunyu Hu <chuhu@redhat.com> - 2017-07-20 12:40 +0200
  Re: [PATCH] tracing: Fix kmemleak in instance_rmdir Steven Rostedt <rostedt@goodmis.org> - 2017-07-20 15:30 +0200

csiph-web