================================================================== BUG: KASAN: use-after-free in atomic_dec_and_test include/asm-generic/atomic-instrumented.h:259 [inline] BUG: KASAN: use-after-free in put_task_struct include/linux/sched/task.h:95 [inline] BUG: KASAN: use-after-free in _free_event+0x39b/0x1220 kernel/events/core.c:4460 Write of size 4 at addr ffff8880806be320 by task syz-executor.1/25990 CPU: 0 PID: 25990 Comm: syz-executor.1 Not tainted 4.19.75 #0 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:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x123/0x190 mm/kasan/kasan.c:267 kasan_check_write+0x14/0x20 mm/kasan/kasan.c:278 atomic_dec_and_test include/asm-generic/atomic-instrumented.h:259 [inline] put_task_struct include/linux/sched/task.h:95 [inline] _free_event+0x39b/0x1220 kernel/events/core.c:4460 put_event+0x47/0x60 kernel/events/core.c:4547 perf_event_release_kernel+0x6d1/0xd80 kernel/events/core.c:4662 perf_release+0x37/0x50 kernel/events/core.c:4672 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x994/0x2fa0 kernel/exit.c:876 do_group_exit+0x135/0x370 kernel/exit.c:979 __do_sys_exit_group kernel/exit.c:990 [inline] __se_sys_exit_group kernel/exit.c:988 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459a09 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffe7b751468 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000000b RCX: 0000000000459a09 RDX: 0000000000413631 RSI: 0000000000a74ef0 RDI: 0000000000000000 RBP: 00000000004bf0ed R08: 000000000000000c R09: 00007ffe7b751570 R10: 0000555556315940 R11: 0000000000000246 R12: 000000000075bfc8 R13: 0000000000000003 R14: 0000000000000001 R15: 000000000075bfd4 Allocated by task 25990: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc_node+0x144/0x710 mm/slab.c:3649 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:802 [inline] copy_process.part.0+0x1ce0/0x7a30 kernel/fork.c:1732 copy_process kernel/fork.c:1689 [inline] _do_fork+0x257/0xfd0 kernel/fork.c:2202 __do_sys_clone kernel/fork.c:2309 [inline] __se_sys_clone kernel/fork.c:2303 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2303 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 25990: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 free_task_struct kernel/fork.c:162 [inline] free_task+0xdd/0x120 kernel/fork.c:416 __put_task_struct+0x20f/0x4c0 kernel/fork.c:689 put_task_struct include/linux/sched/task.h:96 [inline] rdma_restrack_del+0x1da/0x240 drivers/infiniband/core/restrack.c:229 rdma_destroy_id+0xac/0xab0 drivers/infiniband/core/cma.c:1726 ucma_close+0x115/0x320 drivers/infiniband/core/ucma.c:1770 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x994/0x2fa0 kernel/exit.c:876 do_group_exit+0x135/0x370 kernel/exit.c:979 __do_sys_exit_group kernel/exit.c:990 [inline] __se_sys_exit_group kernel/exit.c:988 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880806be300 which belongs to the cache task_struct(49:syz1) of size 6080 The buggy address is located 32 bytes inside of 6080-byte region [ffff8880806be300, ffff8880806bfac0) The buggy address belongs to the page: page:ffffea000201af80 count:1 mapcount:0 mapping:ffff888092890680 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0001573a08 ffffea0001352e08 ffff888092890680 raw: 0000000000000000 ffff8880806be300 0000000100000001 ffff888056c1a900 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888056c1a900 Memory state around the buggy address: ffff8880806be200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880806be280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880806be300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880806be380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880806be400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================