Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1693322
| From | Steven Rostedt <rostedt@goodmis.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [for-next][PATCH 2/3] tracing: Fix kmemleak in instance_rmdir |
| Date | 2017-07-21 03:30 +0200 |
| Message-ID | <u5uVs-6Gx-9@gated-at.bofh.it> (permalink) |
| References | <u5uVr-6Gx-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Chunyu Hu <chuhu@redhat.com>
Hit the kmemleak when executing instance_rmdir, it forgot releasing
mem of tracing_cpumask. With this fix, the warn does not appear any
more.
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
Link: http://lkml.kernel.org/r/1500546969-12594-1-git-send-email-chuhu@redhat.com
Cc: stable@vger.kernel.org
Fixes: ccfe9e42e451 ("tracing: Make tracing_cpumask available for all instances")
Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2d0ffcc49dba..42b9355033d4 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);
--
2.10.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[for-next][PATCH 0/3] tracing: Updates for 4.13-rc2 Steven Rostedt <rostedt@goodmis.org> - 2017-07-21 03:30 +0200 [for-next][PATCH 3/3] trace: fix the errors caused by incompatible type of RCU variables Steven Rostedt <rostedt@goodmis.org> - 2017-07-21 03:30 +0200 [for-next][PATCH 2/3] tracing: Fix kmemleak in instance_rmdir Steven Rostedt <rostedt@goodmis.org> - 2017-07-21 03:30 +0200 [for-next][PATCH 1/3] tracing/ring_buffer: Try harder to allocate Steven Rostedt <rostedt@goodmis.org> - 2017-07-21 03:30 +0200
csiph-web