Zheng Yejian
d5a8218963
tracing: Fix memory leak of iter->temp when reading trace_pipe
...
kmemleak reports:
unreferenced object 0xffff88814d14e200 (size 256):
comm "cat", pid 336, jiffies 4294871818 (age 779.490s)
hex dump (first 32 bytes):
04 00 01 03 00 00 00 00 08 00 00 00 00 00 00 00 ................
0c d8 c8 9b ff ff ff ff 04 5a ca 9b ff ff ff ff .........Z......
backtrace:
[<ffffffff9bdff18f>] __kmalloc+0x4f/0x140
[<ffffffff9bc9238b>] trace_find_next_entry+0xbb/0x1d0
[<ffffffff9bc9caef>] trace_print_lat_context+0xaf/0x4e0
[<ffffffff9bc94490>] print_trace_line+0x3e0/0x950
[<ffffffff9bc95499>] tracing_read_pipe+0x2d9/0x5a0
[<ffffffff9bf03a43>] vfs_read+0x143/0x520
[<ffffffff9bf04c2d>] ksys_read+0xbd/0x160
[<ffffffff9d0f0edf>] do_syscall_64+0x3f/0x90
[<ffffffff9d2000aa>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
when reading file 'trace_pipe', 'iter->temp' is allocated or relocated
in trace_find_next_entry() but not freed before 'trace_pipe' is closed.
To fix it, free 'iter->temp' in tracing_release_pipe().
Link: https://lore.kernel.org/linux-trace-kernel/20230713141435.1133021-1-zhengyejian1@huawei.com
Cc: stable@vger.kernel.org
Fixes: ff895103a84ab ("tracing: Save off entry when peeking at next entry")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2023-07-13 10:48:36 -04:00
..
2023-07-03 18:48:09 +02:00
2023-06-28 10:28:11 -07:00
2023-05-26 19:01:47 +02:00
2023-07-03 09:27:12 +01:00
2023-07-09 10:24:22 -07:00
2023-04-16 14:23:07 +02:00
2023-07-01 08:58:41 -07:00
2023-01-01 11:15:05 -08:00
2022-12-21 14:31:52 -08:00
2023-06-30 11:13:44 +02:00
2023-06-09 23:29:50 +10:00
2023-06-05 13:56:52 +02:00
2023-06-28 10:59:38 -07:00
2023-07-04 10:17:11 -07:00
2023-06-28 10:28:11 -07:00
2023-06-05 21:11:03 +02:00
2023-06-07 13:44:06 -07:00
2023-06-27 16:54:21 -07:00
2023-06-27 21:24:18 -07:00
2023-07-13 10:48:36 -04:00
2022-11-30 16:13:18 -08:00
2022-08-22 18:50:06 -04:00
2022-09-01 17:39:30 -04:00
2022-08-29 19:47:03 -04:00
2023-05-17 11:34:55 -04:00
2023-03-01 10:01:22 -08:00
2022-09-26 19:46:09 -07:00
2023-05-22 14:30:52 -04:00
2022-09-26 10:13:13 -07:00
2023-03-14 19:32:38 -07:00
2023-06-05 09:57:20 +02:00
2023-01-13 11:48:15 +01:00
2023-05-23 18:06:40 +02:00
2023-04-05 19:42:46 -07:00
2022-11-01 10:04:52 -07:00
2023-04-18 16:39:34 -07:00
2023-06-01 17:15:33 -04:00
2022-07-05 13:32:59 -07:00
2023-02-08 13:36:22 +01:00
2023-07-08 14:08:02 -07:00
2022-09-07 21:53:50 +02:00
2023-05-28 16:20:21 +09:00
2022-07-15 18:21:49 +00:00
2023-04-08 13:45:37 -07:00
2023-03-24 11:01:29 +01:00
2022-12-01 15:53:05 -08:00
2022-11-12 18:47:36 -08:00
2023-03-19 13:27:19 -07:00
2022-11-15 00:42:02 -08:00
2023-06-28 15:51:08 -07:00
2023-06-09 17:44:17 -07:00
2023-06-09 17:44:24 -07:00
2023-06-28 10:59:38 -07:00
2022-09-11 21:55:06 -07:00
2023-02-02 22:50:05 -08:00
2023-03-24 20:10:59 -07:00
2023-06-06 21:39:55 +09:00
2023-06-08 12:27:20 -07:00
2023-03-24 17:09:14 +01:00
2023-06-28 10:59:38 -07:00
2022-09-11 21:55:12 -07:00
2023-06-28 15:51:08 -07:00
2023-04-08 13:45:38 -07:00
2023-04-20 22:55:35 -04:00
2023-03-14 17:06:44 +08:00
2023-06-09 17:44:15 -07:00
2023-06-14 12:27:38 -07:00
2023-07-01 08:26:23 -07:00
2023-06-19 16:19:28 -07:00
2023-07-01 08:26:23 -07:00
2022-09-11 21:55:12 -07:00
2023-04-16 14:23:07 +02:00
2022-10-04 15:59:36 +02:00
2023-05-02 17:23:27 -07:00
2023-02-17 14:58:01 -08:00
2022-12-27 12:52:12 +01:00
2022-11-09 18:06:35 +00:00
2023-04-13 11:49:20 -07:00
2023-06-28 16:05:21 -07:00
2023-06-16 22:08:09 +02:00
2023-05-15 13:45:00 +02:00
2023-05-09 21:50:27 +02:00
2023-04-20 11:36:35 +02:00
2022-10-17 16:41:16 +02:00
2022-05-24 11:11:13 -07:00
2023-07-06 10:06:04 -07:00
2023-06-08 07:16:53 -07:00
2022-09-08 16:56:45 -07:00
2023-06-28 16:05:21 -07:00
2022-09-11 21:55:10 -07:00
2022-08-29 12:47:15 +01:00
2023-01-05 12:10:35 -08:00
2023-02-18 14:34:36 -05:00
2022-05-18 18:24:57 -05:00
2023-06-29 15:19:43 -07:00
2023-02-02 22:50:04 -08:00
2022-11-30 20:16:49 -04:00
2022-05-19 23:25:47 -04:00
2023-04-13 11:49:35 -07:00
2023-06-08 15:43:09 -04:00
2023-06-06 10:47:04 +02:00
2023-06-19 16:25:28 -07:00
2023-06-09 17:44:21 -07:00
2023-06-19 16:25:29 -07:00
2023-05-17 17:02:08 -10:00
2023-06-27 16:32:52 -07:00