================================================================== BUG: KASAN: use-after-free in perf_output_read_group kernel/events/core.c:5882 [inline] BUG: KASAN: use-after-free in perf_output_read+0xe4e/0xfc0 kernel/events/core.c:5917 Read of size 8 at addr ffff8881c4397960 by task syz-executor.5/16800 CPU: 0 PID: 16800 Comm: syz-executor.5 Not tainted 4.14.125+ #6 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x10e lib/dump_stack.c:53 print_address_description+0x60/0x226 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xae/0x2d5 mm/kasan/report.c:393 Allocated by task 16802: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x126/0x310 mm/slub.c:2750 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] alloc_perf_context+0x44/0xe0 kernel/events/core.c:3864 find_get_context.isra.0+0x119/0x550 kernel/events/core.c:3953 SYSC_perf_event_open kernel/events/core.c:10160 [inline] SyS_perf_event_open+0x9d3/0x2530 kernel/events/core.c:9988 do_syscall_64+0x19b/0x510 arch/x86/entry/common.c:292 Freed by task 74: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xb0/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kfree+0xf5/0x310 mm/slub.c:3897 __rcu_reclaim kernel/rcu/rcu.h:195 [inline] rcu_do_batch kernel/rcu/tree.c:2699 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline] rcu_process_callbacks+0x56f/0xf40 kernel/rcu/tree.c:2946 __do_softirq+0x234/0x9ca kernel/softirq.c:288 The buggy address belongs to the object at ffff8881c4397900 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 96 bytes inside of 512-byte region [ffff8881c4397900, ffff8881c4397b00) The buggy address belongs to the page: page:ffffea000710e580 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000000000000 00000001000c000c raw: dead000000000100 dead000000000200 ffff8881d6402c00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c4397800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881c4397880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881c4397900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881c4397980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c4397a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================