https://github.com/torvalds/linux
Revision 649e72070cbbb8600eb823833e4748f5a0815116 authored by Wang Yufen on 07 November 2022, 11:04:50 UTC, committed by Steven Rostedt (Google) on 17 November 2022, 01:29:00 UTC
kmemleak reports this issue:

unreferenced object 0xffff888105a18900 (size 128):
  comm "test_progs", pid 18933, jiffies 4336275356 (age 22801.766s)
  hex dump (first 32 bytes):
    25 73 00 90 81 88 ff ff 26 05 00 00 42 01 58 04  %s......&...B.X.
    03 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000560143a1>] __kmalloc_node_track_caller+0x4a/0x140
    [<000000006af00822>] krealloc+0x8d/0xf0
    [<00000000c309be6a>] trace_iter_expand_format+0x99/0x150
    [<000000005a53bdb6>] trace_check_vprintf+0x1e0/0x11d0
    [<0000000065629d9d>] trace_event_printf+0xb6/0xf0
    [<000000009a690dc7>] trace_raw_output_bpf_trace_printk+0x89/0xc0
    [<00000000d22db172>] print_trace_line+0x73c/0x1480
    [<00000000cdba76ba>] tracing_read_pipe+0x45c/0x9f0
    [<0000000015b58459>] vfs_read+0x17b/0x7c0
    [<000000004aeee8ed>] ksys_read+0xed/0x1c0
    [<0000000063d3d898>] do_syscall_64+0x3b/0x90
    [<00000000a06dda7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

iter->fmt alloced in
  tracing_read_pipe() -> .. ->trace_iter_expand_format(), but not
freed, to fix, add free in tracing_release_pipe()

Link: https://lkml.kernel.org/r/1667819090-4643-1-git-send-email-wangyufen@huawei.com

Cc: stable@vger.kernel.org
Fixes: efbbdaa22bb7 ("tracing: Show real address for trace event arguments")
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 31029a8
History
Tip revision: 649e72070cbbb8600eb823833e4748f5a0815116 authored by Wang Yufen on 07 November 2022, 11:04:50 UTC
tracing: Fix memory leak in tracing_read_pipe()
Tip revision: 649e720
File Mode Size
Makefile -rw-r--r-- 366 bytes
advise.c -rw-r--r-- 2.1 KB
advise.h -rw-r--r-- 316 bytes
alloc_cache.h -rw-r--r-- 1.1 KB
cancel.c -rw-r--r-- 7.2 KB
cancel.h -rw-r--r-- 579 bytes
epoll.c -rw-r--r-- 1.5 KB
epoll.h -rw-r--r-- 213 bytes
fdinfo.c -rw-r--r-- 6.5 KB
fdinfo.h -rw-r--r-- 100 bytes
filetable.c -rw-r--r-- 4.4 KB
filetable.h -rw-r--r-- 2.1 KB
fs.c -rw-r--r-- 6.6 KB
fs.h -rw-r--r-- 929 bytes
io-wq.c -rw-r--r-- 33.4 KB
io-wq.h -rw-r--r-- 2.0 KB
io_uring.c -rw-r--r-- 106.1 KB
io_uring.h -rw-r--r-- 9.8 KB
kbuf.c -rw-r--r-- 13.2 KB
kbuf.h -rw-r--r-- 3.6 KB
msg_ring.c -rw-r--r-- 4.1 KB
msg_ring.h -rw-r--r-- 178 bytes
net.c -rw-r--r-- 35.9 KB
net.h -rw-r--r-- 2.2 KB
nop.c -rw-r--r-- 498 bytes
nop.h -rw-r--r-- 168 bytes
notif.c -rw-r--r-- 1.8 KB
notif.h -rw-r--r-- 896 bytes
opdef.c -rw-r--r-- 11.9 KB
opdef.h -rw-r--r-- 1.3 KB
openclose.c -rw-r--r-- 6.1 KB
openclose.h -rw-r--r-- 596 bytes
poll.c -rw-r--r-- 25.9 KB
poll.h -rw-r--r-- 1006 bytes
refs.h -rw-r--r-- 1.2 KB
rsrc.c -rw-r--r-- 31.4 KB
rsrc.h -rw-r--r-- 4.5 KB
rw.c -rw-r--r-- 27.1 KB
rw.h -rw-r--r-- 705 bytes
slist.h -rw-r--r-- 3.0 KB
splice.c -rw-r--r-- 2.9 KB
splice.h -rw-r--r-- 306 bytes
sqpoll.c -rw-r--r-- 9.5 KB
sqpoll.h -rw-r--r-- 753 bytes
statx.c -rw-r--r-- 1.6 KB
statx.h -rw-r--r-- 217 bytes
sync.c -rw-r--r-- 2.7 KB
sync.h -rw-r--r-- 460 bytes
tctx.c -rw-r--r-- 7.2 KB
tctx.h -rw-r--r-- 992 bytes
timeout.c -rw-r--r-- 16.6 KB
timeout.h -rw-r--r-- 1.2 KB
uring_cmd.c -rw-r--r-- 4.0 KB
uring_cmd.h -rw-r--r-- 494 bytes
xattr.c -rw-r--r-- 5.5 KB
xattr.h -rw-r--r-- 654 bytes

back to top