Vamshi K Sthambamkadi
f40fc799af
tracing: Fix memory leak in __create_synth_event()
kmemleak report:
unreferenced object 0xc5a6f708 (size 8):
comm "ftracetest", pid 1209, jiffies 4294911500 (age 6.816s)
hex dump (first 8 bytes):
00 c1 3d 60 14 83 1f 8a ..=`....
backtrace:
[<f0aa4ac4>] __kmalloc_track_caller+0x2a6/0x460
[<7d3d60a6>] kstrndup+0x37/0x70
[<45a0e739>] argv_split+0x1c/0x120
[<c17982f8>] __create_synth_event+0x192/0xb00
[<0708b8a3>] create_synth_event+0xbb/0x150
[<3d1941e1>] create_dyn_event+0x5c/0xb0
[<5cf8b9e3>] trace_parse_run_command+0xa7/0x140
[<04deb2ef>] dyn_event_write+0x10/0x20
[<8779ac95>] vfs_write+0xa9/0x3c0
[<ed93722a>] ksys_write+0x89/0xc0
[<b9ca0507>] __ia32_sys_write+0x15/0x20
[<7ce02d85>] __do_fast_syscall_32+0x45/0x80
[<cb0ecb35>] do_fast_syscall_32+0x29/0x60
[<2467454a>] do_SYSENTER_32+0x15/0x20
[<9beaa61d>] entry_SYSENTER_32+0xa9/0xfc
unreferenced object 0xc5a6f078 (size 8):
comm "ftracetest", pid 1209, jiffies 4294911500 (age 6.816s)
hex dump (first 8 bytes):
08 f7 a6 c5 00 00 00 00 ........
backtrace:
[<bbac096a>] __kmalloc+0x2b6/0x470
[<aa2624b4>] argv_split+0x82/0x120
[<c17982f8>] __create_synth_event+0x192/0xb00
[<0708b8a3>] create_synth_event+0xbb/0x150
[<3d1941e1>] create_dyn_event+0x5c/0xb0
[<5cf8b9e3>] trace_parse_run_command+0xa7/0x140
[<04deb2ef>] dyn_event_write+0x10/0x20
[<8779ac95>] vfs_write+0xa9/0x3c0
[<ed93722a>] ksys_write+0x89/0xc0
[<b9ca0507>] __ia32_sys_write+0x15/0x20
[<7ce02d85>] __do_fast_syscall_32+0x45/0x80
[<cb0ecb35>] do_fast_syscall_32+0x29/0x60
[<2467454a>] do_SYSENTER_32+0x15/0x20
[<9beaa61d>] entry_SYSENTER_32+0xa9/0xfc
In __create_synth_event(), while iterating field/type arguments, the
argv_split() will return array of atleast 2 elements even when zero
arguments(argc=0) are passed. for e.g. when there is double delimiter
or string ends with delimiter
To fix call argv_free() even when argc=0.
Link: https://lkml.kernel.org/r/20210304094521.GA1826@cosmos
Signed-off-by: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-03-04 09:45:57 -05:00
..
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-06 17:39:38 +01:00
2021-02-26 09:41:05 -08:00
2021-02-26 13:59:32 -08:00
2021-02-17 14:12:43 +01:00
2021-02-26 09:41:03 -08:00
2021-02-05 11:03:47 -08:00
2021-02-24 10:13:55 -08:00
2021-01-04 14:39:07 -08:00
2021-02-08 12:22:08 +01:00
2021-02-26 09:41:03 -08:00
2021-02-15 18:50:01 +01:00
2021-02-22 13:43:55 +01:00
2021-02-21 12:35:04 -08:00
2021-02-26 09:41:03 -08:00
2021-02-21 12:04:41 -08:00
2021-03-04 09:45:57 -05:00
2020-12-15 22:46:15 -08:00
2020-07-16 12:35:15 -07:00
2021-02-23 10:25:27 -05:00
2020-12-03 14:58:35 +01:00
2020-12-03 14:58:35 +01:00
2021-01-15 11:58:10 -05:00
2020-08-17 20:26:58 -04:00
2020-08-23 17:36:59 -05:00
2021-02-23 13:39:45 -08:00
2020-07-30 11:15:58 -07:00
2021-01-24 14:27:16 +01:00
2020-08-23 17:36:59 -05:00
2020-09-01 09:58:03 +02:00
2021-01-06 16:24:59 -08:00
2020-12-15 22:46:18 -08:00
2020-12-30 19:36:54 -07:00
2020-12-15 22:46:19 -08:00
2021-01-11 12:55:01 +01:00
2021-02-12 12:54:58 +01:00
2021-02-26 09:41:03 -08:00
2020-11-02 12:14:19 -08:00
2020-11-24 16:47:49 +01:00
2020-12-18 16:53:12 +01:00
2021-02-08 12:24:04 +01:00
2020-12-15 19:36:48 -08:00
2021-02-17 14:12:24 +01:00
2020-11-02 18:00:20 -08:00
2021-02-21 09:29:23 -08:00
2021-02-10 15:49:38 -05:00
2021-02-22 12:33:26 +00:00
2020-10-05 13:37:03 +02:00
2020-08-12 10:58:01 -07:00
2021-02-19 14:57:12 -05:00
2021-01-24 10:09:20 -08:00
2021-02-16 09:59:41 +01:00
2021-01-19 10:24:45 +01:00
2021-01-19 10:24:45 +01:00
2021-02-10 16:57:04 +01:00
2020-09-01 09:58:03 +02:00
2020-12-14 16:40:27 -08:00
2020-09-04 17:51:55 +10:00
2020-11-14 11:26:04 -08:00
2020-12-17 13:01:31 -08:00
2020-12-14 16:40:27 -08:00
2020-12-15 19:36:48 -08:00
2021-02-21 17:25:22 -07:00
2020-10-16 11:11:19 -07:00
2020-12-15 22:46:19 -08:00
2020-07-27 14:31:12 -04:00
2020-12-15 22:46:18 -08:00
2020-11-25 18:52:35 +01:00
2021-01-12 14:26:31 +01:00
2021-01-04 13:53:41 -08:00
2020-12-01 10:30:28 +00:00
2021-02-10 12:40:11 -08:00
2021-02-21 17:25:22 -07:00
2021-02-17 14:12:42 +01:00
2021-01-22 15:09:42 +01:00
2021-02-10 23:34:16 +01:00
2020-09-19 13:13:39 -07:00
2020-09-18 14:24:16 +01:00
2021-02-17 14:12:42 +01:00
2020-11-27 11:10:50 +01:00
2020-12-19 11:18:38 -08:00
2021-02-25 10:17:31 -08:00
2021-02-26 09:41:03 -08:00
2020-12-12 09:17:38 -07:00
2020-11-16 08:08:54 -08:00
2021-01-06 17:17:22 -08:00
2021-02-09 12:27:29 -05:00
2020-10-06 10:31:52 -07:00
2020-12-14 16:40:27 -08:00
2020-08-19 14:14:12 +02:00
2020-08-19 14:13:20 +02:00
2021-01-26 11:16:34 +00:00
2020-11-14 11:26:03 -08:00
2021-02-22 17:06:54 -08:00