================================================================== BUG: KASAN: use-after-free in uprobe_perf_close+0x39d/0x490 kernel/trace/trace_uprobe.c:1033 Read of size 4 at addr ffff8880747e4324 by task syz-executor556/8181 CPU: 1 PID: 8181 Comm: syz-executor556 Not tainted 5.0.0-rc6-next-20190215 #36 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 uprobe_perf_close+0x39d/0x490 kernel/trace/trace_uprobe.c:1033 trace_uprobe_register+0x246/0x960 kernel/trace/trace_uprobe.c:1217 perf_trace_event_close kernel/trace/trace_event_perf.c:187 [inline] perf_uprobe_destroy+0xa0/0x130 kernel/trace/trace_event_perf.c:341 _free_event+0x356/0x13b0 kernel/events/core.c:4451 free_event+0x5f/0xd0 kernel/events/core.c:4478 perf_event_release_kernel+0x5b2/0xbe0 kernel/events/core.c:4639 perf_release+0x37/0x50 kernel/events/core.c:4653 __fput+0x2e5/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4060c1 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 b4 17 00 00 c3 48 83 ec 08 e8 6a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 b3 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007fffc71282c0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00000000004060c1 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000006dcc2c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00000000006dcc40 R13: 0000000000000000 R14: 000000000000002d R15: 20c49ba5e353f7cf Allocated by task 8182: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 kmem_cache_alloc_node+0x144/0x710 mm/slab.c:3641 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:844 [inline] copy_process.part.0+0x1d35/0x79e0 kernel/fork.c:1753 copy_process kernel/fork.c:1710 [inline] _do_fork+0x257/0xfd0 kernel/fork.c:2227 __do_sys_clone kernel/fork.c:2334 [inline] __se_sys_clone kernel/fork.c:2328 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2328 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8182: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3491 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3759 free_task_struct kernel/fork.c:162 [inline] free_task+0xdd/0x120 kernel/fork.c:457 copy_process.part.0+0x1a67/0x79e0 kernel/fork.c:2159 copy_process kernel/fork.c:1710 [inline] _do_fork+0x257/0xfd0 kernel/fork.c:2227 __do_sys_clone kernel/fork.c:2334 [inline] __se_sys_clone kernel/fork.c:2328 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2328 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880747e4300 which belongs to the cache task_struct(23:syz3) of size 6080 The buggy address is located 36 bytes inside of 6080-byte region [ffff8880747e4300, ffff8880747e5ac0) The buggy address belongs to the page: page:ffffea0001d1f900 count:1 mapcount:0 mapping:ffff88808330ce40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001c77488 ffff8880a32ba348 ffff88808330ce40 raw: 0000000000000000 ffff8880747e4300 0000000100000001 ffff888031ed2300 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888031ed2300 Memory state around the buggy address: ffff8880747e4200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880747e4280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880747e4300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880747e4380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880747e4400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================