binder: 11278:11298 ioctl 40046207 0 returned -16 binder_alloc: 11278: binder_alloc_buf, no vma binder: 11278:11289 transaction failed 29189/-3, size 0-0 line 2963 ================================================================== BUG: KASAN: use-after-free in uprobe_perf_close+0x3e0/0x570 kernel/trace/trace_uprobe.c:1048 Read of size 4 at addr ffff8801b460438c by task syz-executor1/11299 CPU: 1 PID: 11299 Comm: syz-executor1 Not tainted 4.16.0+ #15 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1a7/0x27d lib/dump_stack.c:53 binder: 11278:11289 ioctl c0306201 20000140 returned -14 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 uprobe_perf_close+0x3e0/0x570 kernel/trace/trace_uprobe.c:1048 binder: BINDER_SET_CONTEXT_MGR already set trace_uprobe_register+0x4cb/0xc00 kernel/trace/trace_uprobe.c:1210 binder: 11329:11330 ioctl 40046207 0 returned -16 perf_trace_event_close kernel/trace/trace_event_perf.c:186 [inline] perf_uprobe_destroy+0x9b/0x130 kernel/trace/trace_event_perf.c:335 _free_event+0x3d7/0x11f0 kernel/events/core.c:4445 binder_alloc: 11278: binder_alloc_buf, no vma put_event+0x35/0x40 kernel/events/core.c:4528 perf_event_release_kernel+0x6e8/0xfe0 kernel/events/core.c:4634 binder: 11329:11330 transaction failed 29189/-3, size 0-0 line 2963 binder: 11329:11330 ioctl c0306201 20000140 returned -14 binder: BINDER_SET_CONTEXT_MGR already set perf_release+0x37/0x50 kernel/events/core.c:4644 __fput+0x327/0x7f0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x1ab/0x280 kernel/task_work.c:113 binder: 11331:11332 ioctl 40046207 0 returned -16 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x1986/0x2700 kernel/exit.c:865 binder_alloc: 11278: binder_alloc_buf, no vma binder: 11331:11332 transaction failed 29189/-3, size 0-0 line 2963 binder: 11331:11332 ioctl c0306201 20000140 returned -14 binder: BINDER_SET_CONTEXT_MGR already set do_group_exit+0x149/0x400 kernel/exit.c:968 binder: 11333:11334 ioctl 40046207 0 returned -16 get_signal+0x74c/0x16e0 kernel/signal.c:2469 binder_alloc: 11278: binder_alloc_buf, no vma do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:810 binder: 11333:11334 transaction failed 29189/-3, size 0-0 line 2963 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162 binder: 11333:11334 ioctl c0306201 20000140 returned -14 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4552d9 RSP: 002b:00007f608432dc68 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: 0000000000010000 RBX: 00007f608432e6d4 RCX: 00000000004552d9 RDX: 0000000000000000 RSI: 0000000000000021 RDI: 000000000000001a RBP: 000000000072c010 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000020004 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004c5 R14: 00000000006fa318 R15: 0000000000000002 Allocated by task 11279: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 slab_post_alloc_hook mm/slab.h:443 [inline] slab_alloc_node mm/slab.c:3323 [inline] kmem_cache_alloc_node+0x131/0x760 mm/slab.c:3630 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:770 [inline] copy_process.part.38+0x1ab9/0x6140 kernel/fork.c:1631 copy_process kernel/fork.c:1606 [inline] _do_fork+0x1f7/0xfa0 kernel/fork.c:2087 SYSC_clone kernel/fork.c:2194 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2188 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 4423: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kmem_cache_free+0x83/0x2a0 mm/slab.c:3744 free_task_struct kernel/fork.c:162 [inline] free_task+0x155/0x1b0 kernel/fork.c:391 __put_task_struct+0x24b/0x3e0 kernel/fork.c:657 put_task_struct include/linux/sched/task.h:96 [inline] delayed_put_task_struct+0xd8/0x3e0 kernel/exit.c:180 __rcu_reclaim kernel/rcu/rcu.h:178 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2930 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2897 [inline] rcu_process_callbacks+0xd6c/0x17b0 kernel/rcu/tree.c:2914 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801b4604340 which belongs to the cache task_struct(97:syz1) of size 6016 The buggy address is located 76 bytes inside of 6016-byte region [ffff8801b4604340, ffff8801b4605ac0) The buggy address belongs to the page: page:ffffea0006d18100 count:1 mapcount:0 mapping:ffff8801b4604340 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801b4604340 0000000000000000 0000000100000001 raw: ffffea0006fe06a0 ffffea00075cf820 ffff8801ba114000 ffff8801b017a140 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8801b017a140 Memory state around the buggy address: ffff8801b4604280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801b4604300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801b4604380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801b4604400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b4604480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================