================================================================== BUG: KASAN: use-after-free in uprobe_cmp syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:620 [inline] BUG: KASAN: use-after-free in __uprobe_cmp_key syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:646 [inline] BUG: KASAN: use-after-free in rb_find syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/rbtree.h:289 [inline] BUG: KASAN: use-after-free in __find_uprobe syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:661 [inline] BUG: KASAN: use-after-free in find_uprobe+0x12c/0x150 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:678 Read of size 8 at addr ffff88802dcaed68 by task syz-executor.2/10856 CPU: 1 PID: 10856 Comm: syz-executor.2 Not tainted 5.11.0-rc6-next-20210205-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/report.c:232 __kasan_report syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/report.c:416 uprobe_cmp syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:620 [inline] __uprobe_cmp_key syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:646 [inline] rb_find syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/rbtree.h:289 [inline] __find_uprobe syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:661 [inline] find_uprobe+0x12c/0x150 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:678 uprobe_apply+0x26/0x130 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:1221 uprobe_perf_close+0x41e/0x6f0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1287 trace_uprobe_register+0x3e7/0x880 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1466 perf_trace_event_close syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:192 [inline] perf_uprobe_destroy+0x98/0x130 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:348 _free_event+0x2ee/0x1380 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:4830 put_event syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:4924 [inline] perf_event_release_kernel+0xa24/0xe00 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:5039 perf_release+0x33/0x40 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:5049 __fput+0x283/0x920 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/fs/file_table.c:280 task_work_run+0xdd/0x190 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/task_work.c:140 tracehook_notify_resume syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/entry/common.c:201 __syscall_exit_to_user_mode_work syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x50 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/entry/common.c:302 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x418e1b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffe1f894570 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000009 RCX: 0000000000418e1b RDX: 0000000000000000 RSI: 0000000000572418 RDI: 0000000000000008 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2c2283c0 R10: 00007ffe1f894660 R11: 0000000000000293 R12: 00000000000003e8 R13: 000000000002c9bf R14: 000000000056bf60 R15: 000000000056bf60 Allocated by task 10861: kasan_save_stack+0x1b/0x40 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:38 kasan_set_track syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:46 [inline] set_alloc_info syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:403 [inline] ____kasan_kmalloc syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:434 [inline] ____kasan_kmalloc.constprop.0+0xa0/0xd0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:406 kmalloc syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/slab.h:556 [inline] kzalloc syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/slab.h:686 [inline] alloc_uprobe syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:731 [inline] __uprobe_register+0x19c/0x850 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:1167 trace_uprobe_enable syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1060 [inline] probe_event_enable+0x357/0xa00 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1129 trace_uprobe_register+0x443/0x880 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1456 perf_trace_event_reg syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:129 [inline] perf_trace_event_init+0x549/0xa20 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:204 perf_uprobe_init+0x16f/0x210 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:336 perf_uprobe_event_init+0xff/0x1c0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:9721 perf_try_init_event+0x12a/0x560 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11038 perf_init_event syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11090 [inline] perf_event_alloc.part.0+0xe3b/0x3960 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11370 perf_event_alloc syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11749 [inline] __do_sys_perf_event_open+0x647/0x2e60 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11847 do_syscall_64+0x2d/0x70 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 10861: kasan_save_stack+0x1b/0x40 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/generic.c:357 ____kasan_slab_free.part.0+0xe1/0x110 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/kasan/common.c:364 kasan_slab_free syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/./include/linux/kasan.h:191 [inline] slab_free_hook syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/slub.c:1562 [inline] slab_free_freelist_hook+0x82/0x1d0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/slub.c:1600 slab_free syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/slub.c:3161 [inline] kfree+0xe5/0x7b0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/mm/slub.c:4202 put_uprobe syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:612 [inline] put_uprobe+0x13b/0x190 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:601 uprobe_apply+0xfc/0x130 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/uprobes.c:1231 uprobe_perf_open syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1311 [inline] trace_uprobe_register+0x5c9/0x880 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_uprobe.c:1463 perf_trace_event_open syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:186 [inline] perf_trace_event_init syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:208 [inline] perf_trace_event_init+0x17a/0xa20 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:195 perf_uprobe_init+0x16f/0x210 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/trace/trace_event_perf.c:336 perf_uprobe_event_init+0xff/0x1c0 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:9721 perf_try_init_event+0x12a/0x560 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11038 perf_init_event syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11090 [inline] perf_event_alloc.part.0+0xe3b/0x3960 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11370 perf_event_alloc syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11749 [inline] __do_sys_perf_event_open+0x647/0x2e60 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/kernel/events/core.c:11847 do_syscall_64+0x2d/0x70 syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802dcaec00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 360 bytes inside of 512-byte region [ffff88802dcaec00, ffff88802dcaee00) The buggy address belongs to the page: page:00000000ff5e3708 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802dcae800 pfn:0x2dcae head:00000000ff5e3708 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea0000b68d88 ffffea00008da088 ffff888010841c80 raw: ffff88802dcae800 0000000000080007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802dcaec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802dcaec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802dcaed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802dcaed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802dcaee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================