================================================================== BUG: KASAN: use-after-free in uprobe_perf_close+0x45e/0x5f0 kernel/trace/trace_uprobe.c:1048 Read of size 4 at addr ffff8801b135e78c by task syz-executor6/24724 CPU: 0 PID: 24724 Comm: syz-executor6 Not tainted 4.16.0+ #19 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+0x1b9/0x294 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0xac/0x2f5 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 uprobe_perf_close+0x45e/0x5f0 kernel/trace/trace_uprobe.c:1048 trace_uprobe_register+0x355/0xcd0 kernel/trace/trace_uprobe.c:1210 perf_trace_event_close kernel/trace/trace_event_perf.c:186 [inline] perf_uprobe_destroy+0xa0/0x130 kernel/trace/trace_event_perf.c:335 _free_event+0x3ff/0x13b0 kernel/events/core.c:4445 put_event+0x48/0x60 kernel/events/core.c:4528 perf_event_release_kernel+0x8bd/0xf90 kernel/events/core.c:4634 perf_release+0x37/0x50 kernel/events/core.c:4644 __fput+0x34d/0x890 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x1e4/0x290 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x1aee/0x2730 kernel/exit.c:865 do_group_exit+0x16f/0x430 kernel/exit.c:968 get_signal+0x886/0x1960 kernel/signal.c:2469 do_signal+0x98/0x2040 arch/x86/kernel/signal.c:810 exit_to_usermode_loop+0x28a/0x310 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_64+0x792/0x9d0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x455259 RSP: 002b:00007fad2844bce8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000072bf80 RCX: 0000000000455259 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000072bf80 RBP: 000000000072bf80 R08: 0000000000000000 R09: 000000000072bf58 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000a3e81f R14: 00007fad2844c9c0 R15: 0000000000000001 Allocated by task 24718: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc_node+0x144/0x780 mm/slab.c:3644 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:772 [inline] copy_process.part.38+0x16bf/0x6ee0 kernel/fork.c:1633 copy_process kernel/fork.c:1608 [inline] _do_fork+0x291/0x12a0 kernel/fork.c:2089 SYSC_clone kernel/fork.c:2196 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2190 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 24726: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x86/0x2d0 mm/slab.c:3756 free_task_struct kernel/fork.c:162 [inline] free_task+0x166/0x1d0 kernel/fork.c:391 __put_task_struct+0x2d2/0x600 kernel/fork.c:659 put_task_struct include/linux/sched/task.h:96 [inline] delayed_put_task_struct+0x367/0x470 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+0x941/0x15f0 kernel/rcu/tree.c:2914 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801b135e740 which belongs to the cache task_struct(49:syz6) of size 6016 The buggy address is located 76 bytes inside of 6016-byte region [ffff8801b135e740, ffff8801b135fec0) The buggy address belongs to the page: page:ffffea0006c4d780 count:1 mapcount:0 mapping:ffff8801b135e740 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801b135e740 0000000000000000 0000000100000001 raw: ffffea00062c97a0 ffffea0007051020 ffff8801b2a029c0 ffff8801d927ab00 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8801d927ab00 Memory state around the buggy address: ffff8801b135e680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801b135e700: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801b135e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801b135e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b135e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================