Masami Hiramatsu
5da13ab8b0
perf/core: Fix perf_kprobe_init()
Fix error handling in perf_kprobe_init():
==================================================================
BUG: KASAN: slab-out-of-bounds in strlen+0x8e/0xa0 lib/string.c:482
Read of size 1 at addr ffff88003f9cc5c0 by task syz-executor2/23095
CPU: 0 PID: 23095 Comm: syz-executor2 Not tainted 4.16.0+ #24
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0xca/0x13e lib/dump_stack.c:113
print_address_description+0x6e/0x2c0 mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report+0x256/0x380 mm/kasan/report.c:412
strlen+0x8e/0xa0 lib/string.c:482
kstrdup+0x21/0x70 mm/util.c:55
alloc_trace_kprobe+0xc8/0x930 kernel/trace/trace_kprobe.c:325
create_local_trace_kprobe+0x4f/0x3a0 kernel/trace/trace_kprobe.c:1438
perf_kprobe_init+0x149/0x1f0 kernel/trace/trace_event_perf.c:264
perf_kprobe_event_init+0xa8/0x120 kernel/events/core.c:8407
perf_try_init_event+0xcb/0x2a0 kernel/events/core.c:9719
perf_init_event kernel/events/core.c:9750 [inline]
perf_event_alloc+0x1367/0x1e20 kernel/events/core.c:10022
SYSC_perf_event_open+0x242/0x2330 kernel/events/core.c:10477
do_syscall_64+0x198/0x640 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
Reported-by: 范龙飞 <long7573@126.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: e12f03d703 ("perf/core: Implement the 'perf_kprobe' PMU")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-04-10 07:33:10 +02:00
..
2018-03-20 23:50:39 +01:00
2018-02-21 11:39:22 -08:00
2018-02-10 13:16:35 -08:00
2018-01-03 18:01:08 -06:00
2018-04-09 18:15:58 +02:00
2017-11-02 11:10:55 +01:00
2018-02-22 22:05:43 +01:00
2018-01-31 16:36:38 +01:00
2018-03-31 07:30:50 +02:00
2018-04-02 20:16:05 +02:00
2018-03-01 10:06:39 -08:00
2018-02-23 15:15:41 -08:00
2018-04-02 21:22:12 -07:00
2018-04-02 11:49:41 -07:00
2018-04-10 07:33:10 +02:00
2018-01-04 16:45:09 -08:00
2018-02-06 18:32:44 -08:00
2017-11-14 14:08:20 -08:00
2017-08-16 16:48:34 -07:00
2017-11-10 16:08:47 -05:00
2017-11-15 13:28:48 -08:00
2017-11-10 16:08:56 -05:00
2017-11-15 13:28:48 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:15:32 +02:00
2017-07-31 13:09:49 +02:00
2018-03-15 20:34:40 +01:00
2018-01-13 10:42:48 -08:00
2018-01-16 03:29:36 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:14:51 +02:00
2018-02-21 16:54:06 +01:00
2018-03-12 16:16:00 +01:00
2018-04-02 20:16:06 +02:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:46 -08:00
2017-12-14 16:00:49 -08:00
2018-01-08 19:43:15 +01:00
2018-03-20 08:57:17 +01:00
2018-02-01 13:36:15 -08:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:46 -08:00
2017-07-18 11:38:04 +02:00
2017-11-07 15:35:57 +01:00
2017-11-02 11:10:55 +01:00
2018-04-02 20:15:01 +02:00
2017-09-08 18:26:51 -07:00
2018-02-16 09:12:58 +01:00
2017-11-21 16:35:54 -08:00
2018-01-12 17:33:38 -08:00
2018-03-06 10:58:54 -08:00
2018-04-02 20:20:12 -07:00
2018-01-05 18:43:00 +11:00
2018-04-02 09:08:26 -07:00
2017-10-03 17:54:26 -07:00
2018-04-02 20:14:51 +02:00
2018-02-06 18:32:46 -08:00
2018-02-06 18:32:46 -08:00
2017-11-02 11:10:55 +01:00
2017-11-17 16:10:04 -08:00
2018-02-21 15:35:43 -08:00
2018-02-06 22:15:42 -08:00
2018-02-22 10:50:24 -08:00
2018-04-02 20:15:29 +02:00
2017-11-08 11:13:50 +01:00
2017-10-04 10:53:54 +02:00
2017-11-02 11:10:55 +01:00
2017-12-04 10:28:58 -08:00
2018-04-02 20:16:20 +02:00
2018-04-02 20:16:06 +02:00
2017-11-02 11:10:55 +01:00
2018-02-06 18:32:47 -08:00
2017-12-17 13:57:15 +01:00
2018-02-06 18:32:46 -08:00
2017-10-20 11:02:54 +02:00
2017-12-11 09:18:30 -08:00
2017-12-04 10:52:56 -08:00
2018-04-02 20:15:59 +02:00
2018-04-02 20:15:30 +02:00
2018-04-02 20:14:51 +02:00
2017-08-29 15:14:38 +02:00
2017-11-16 12:20:15 -08:00
2018-02-22 10:21:02 -08:00
2017-11-04 08:53:04 +01:00
2017-11-08 10:17:15 +01:00
2017-11-06 12:26:49 -08:00
2018-03-20 08:08:02 +01:00