Wang Yufen
2c21ee020c
tracing: Fix memory leak in tracing_read_pipe()
commit 649e72070cbbb8600eb823833e4748f5a0815116 upstream.
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: efbbdaa22b ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-26 09:24:42 +01:00
..
2022-08-17 14:23:13 +02:00
2022-05-01 17:22:26 +02:00
2022-11-26 09:24:42 +01:00
2022-11-10 18:15:38 +01:00
2022-07-29 17:25:29 +02:00
2022-07-29 17:25:29 +02:00
2022-07-29 17:25:29 +02:00
2022-11-26 09:24:42 +01:00
2022-06-09 10:23:21 +02:00
2021-11-18 19:16:15 +01:00
2022-10-26 12:34:31 +02:00
2022-08-25 11:39:57 +02:00
2022-03-08 19:12:33 +01:00
2022-07-21 21:24:11 +02:00
2022-10-26 12:34:32 +02:00
2022-09-15 11:30:02 +02:00
2022-08-25 11:39:58 +02:00
2021-11-18 19:16:15 +01:00
2021-11-18 19:16:15 +01:00
2022-10-26 12:34:31 +02:00
2022-10-26 12:35:27 +02:00
2021-09-03 19:42:35 -04:00
2022-09-20 12:39:43 +02:00
2021-11-18 19:16:15 +01:00
2022-10-26 12:34:32 +02:00
2022-08-25 11:39:58 +02:00
2021-11-18 19:16:15 +01:00
2021-11-18 19:16:15 +01:00
2021-11-18 19:16:15 +01:00
2021-09-08 15:29:16 -04:00
2022-06-14 18:36:14 +02:00
2022-03-08 19:12:38 +01:00
2022-11-26 09:24:42 +01:00
2022-08-17 14:24:26 +02:00
2021-12-17 10:30:16 +01:00