------------[ cut here ]------------ kernfs_put: syz1/memory.events.local: released with incorrect active_ref 0 WARNING: CPU: 1 PID: 303 at fs/kernfs/dir.c:531 kernfs_put.part.0+0x433/0x540 Modules linked in: CPU: 1 PID: 303 Comm: kworker/1:4 Not tainted 5.19.0-rc5-next-20220706 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: events kernfs_notify_workfn RIP: 0010:kernfs_put.part.0+0x433/0x540 ------------[ cut here ]------------ Code: 03 80 3c 18 00 0f 85 ea 00 00 00 4d 8b 7d 38 e8 53 fc a6 ff 48 8b 14 24 44 89 f1 4c 89 fe 48 c7 c7 e0 5b 72 84 e8 13 aa 6c 02 <0f> 0b e9 b9 fc ff ff 48 89 ef e8 0e b3 d9 ff e9 c1 fd ff ff e8 04 WARNING: CPU: 0 PID: 4498 at fs/kernfs/dir.c:504 kernfs_get.part.0+0x69/0x80 RSP: 0018:ffff88802004fbd8 EFLAGS: 00010286 Modules linked in: CPU: 0 PID: 4498 Comm: syz-executor.4 Not tainted 5.19.0-rc5-next-20220706 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:kernfs_get.part.0+0x69/0x80 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 Code: 31 ff 89 ee e8 a8 fd a6 ff 85 ed 74 18 e8 cf 00 a7 ff be 04 00 00 00 48 89 df e8 d2 ba d9 ff f0 ff 03 5b 5d c3 e8 b7 00 a7 ff <0f> 0b eb df 48 89 df e8 7b b7 d9 ff eb c6 66 0f 1f 84 00 00 00 00 RDX: ffff888018273580 RSI: ffffffff812bd348 RDI: ffffed1004009f6d RSP: 0018:ffff88806ce09c80 EFLAGS: 00010046 RBP: ffff88801a36d5a8 R08: 0000000000000005 R09: 0000000000000000 RAX: 0000000000000000 RBX: ffff88801a36d570 RCX: 0000000000000100 RDX: ffff888035470000 RSI: ffffffff819df849 RDI: 0000000000000005 R10: 0000000080000000 R11: 0000000000000001 R12: ffff88801a36d570 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: 1ffffffff0a01e40 R14: ffff88801a36d570 R15: ffff888044c9c4f0 R13: ffff88801d86ebc8 R14: 0000000000000000 R15: ffff888014b23190 FS: 0000555555cce400(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 FS: 0000000000000000(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f758bf97547 CR3: 000000001bd90000 CR4: 0000000000350ef0 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Call Trace: kernfs_get+0x1b/0x30 CR2: 0000000000000000 CR3: 0000000016cfc000 CR4: 0000000000350ee0 kernfs_notify+0x180/0x350 Call Trace: cgroup_file_notify+0xf5/0x1a0 kernfs_put+0x42/0x50 call_timer_fn+0x17d/0x5f0 kernfs_notify_workfn+0x417/0x560 process_one_work+0xa0f/0x1690 __run_timers.part.0+0x65e/0xa50 worker_thread+0x637/0x1250 run_timer_softirq+0xae/0x1a0 kthread+0x2ed/0x3a0 __do_softirq+0x1c8/0x8cc __irq_exit_rcu+0x113/0x170 ret_from_fork+0x22/0x30 irq_exit_rcu+0x5/0x20 sysvec_apic_timer_interrupt+0x8e/0xc0 irq event stamp: 125047 asm_sysvec_apic_timer_interrupt+0x1b/0x20 hardirqs last enabled at (125057): [] console_emit_next_record.constprop.0+0x648/0x800 RIP: 0010:__memset+0x24/0x30 hardirqs last disabled at (125066): [] console_emit_next_record.constprop.0+0x667/0x800 Code: cc cc cc cc cc cc 0f 1f 44 00 00 49 89 f9 48 89 d1 83 e2 07 48 c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 f3 RSP: 0018:ffff8880455f78b8 EFLAGS: 00000212 softirqs last enabled at (124308): [] __irq_exit_rcu+0x113/0x170 RAX: 0000000000000000 RBX: ffff8880455f79a8 RCX: 0000000000000004 softirqs last disabled at (124291): [] __irq_exit_rcu+0x113/0x170 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8880455f7960 ---[ end trace 0000000000000000 ]--- RBP: ffff888035470000 R08: 0000000000000001 R09: ffff8880455f7910 R10: ffffed1008abef2f R11: 0000000000000001 R12: 0000000000000000 R13: ffff8880455f7938 R14: ffff888035470000 R15: ffff8880455f7910 __unwind_start+0x2a/0x7c0 arch_stack_walk+0x5f/0xf0 stack_trace_save+0x8c/0xc0 kasan_save_stack+0x1e/0x40 __kasan_slab_alloc+0x66/0x80 kmem_cache_alloc_lru+0x246/0x7e0 __d_alloc+0x31/0x990 d_alloc+0x46/0x1c0 __lookup_hash+0xc8/0x190 filename_create+0x1d6/0x4a0 do_symlinkat+0xc4/0x2a0 __x64_sys_symlink+0x75/0x90 ================================================================== do_syscall_64+0x3b/0x90 BUG: KASAN: use-after-free in llist_del_first+0x89/0xa0 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Read of size 8 at addr ffff88801a36d508 by task kworker/1:4/303 RIP: 0033:0x7fd5305d7427 CPU: 1 PID: 303 Comm: kworker/1:4 Tainted: G W 5.19.0-rc5-next-20220706 #1 Code: 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 58 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RSP: 002b:00007fff368a1bc8 EFLAGS: 00000202 Workqueue: events kernfs_notify_workfn ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fd5305d7427 Call Trace: RDX: 00007fff368a1ca3 RSI: 00007fd530632022 RDI: 00007fff368a1c90 RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fff368a1a60 dump_stack_lvl+0x8b/0xb3 R10: 00007fff368a1917 R11: 0000000000000202 R12: 0000000000000001 print_report.cold+0x5e/0x5e1 R13: 0000000000000001 R14: 0000000000000001 R15: 00007fff368a1c90 kasan_report+0xb1/0x1b0 irq event stamp: 715 hardirqs last enabled at (714): [] _raw_spin_unlock_irq+0x1f/0x40 llist_del_first+0x89/0xa0 hardirqs last disabled at (715): [] _raw_spin_lock_irqsave+0x4e/0x50 kernfs_notify_workfn+0x78/0x560 softirqs last enabled at (0): [] copy_process+0x1dfa/0x6d60 softirqs last disabled at (707): [] __irq_exit_rcu+0x113/0x170 ---[ end trace 0000000000000000 ]--- process_one_work+0xa0f/0x1690 worker_thread+0x637/0x1250 kthread+0x2ed/0x3a0 ret_from_fork+0x22/0x30 Allocated by task 294: kasan_save_stack+0x1e/0x40 __kasan_slab_alloc+0x66/0x80 kmem_cache_alloc+0x1b1/0x490 __kernfs_new_node+0xd4/0x8b0 kernfs_new_node+0x93/0x120 __kernfs_create_file+0x51/0x350 cgroup_addrm_files+0x3e2/0x9d0 css_populate_dir+0x19b/0x450 cgroup_apply_control_enable+0x3ae/0xa40 cgroup_mkdir+0x824/0x11f0 kernfs_iop_mkdir+0x149/0x1d0 vfs_mkdir+0x417/0x6a0 do_mkdirat+0x17b/0x2e0 __x64_sys_mkdir+0xf2/0x140 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 303: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0x108/0x190 kmem_cache_free+0xfb/0x600 kernfs_put.part.0+0x2c7/0x540 kernfs_put+0x42/0x50 kernfs_notify_workfn+0x417/0x560 process_one_work+0xa0f/0x1690 worker_thread+0x637/0x1250 kthread+0x2ed/0x3a0 ret_from_fork+0x22/0x30 The buggy address belongs to the object at ffff88801a36d488 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 128 bytes inside of 168-byte region [ffff88801a36d488, ffff88801a36d530) The buggy address belongs to the physical page: page:0000000089b65c6f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a36d flags: 0x100000000000200(slab|node=0|zone=1) raw: 0100000000000200 0000000000000000 dead000000000122 ffff8880080358c0 raw: 0000000000000000 0000000000110011 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801a36d400: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88801a36d480: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801a36d500: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb ^ ffff88801a36d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801a36d600: fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 ================================================================== loop7: detected capacity change from 0 to 2048 EXT4-fs (loop7): mounted filesystem without journal. Quota mode: writeback. EXT4-fs (loop7): unmounting filesystem. SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pid=4527 comm=syz-executor.2 ---------------- Code disassembly (best guess): 0: cc int3 1: cc int3 2: cc int3 3: cc int3 4: cc int3 5: cc int3 6: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) b: 49 89 f9 mov %rdi,%r9 e: 48 89 d1 mov %rdx,%rcx 11: 83 e2 07 and $0x7,%edx 14: 48 c1 e9 03 shr $0x3,%rcx 18: 40 0f b6 f6 movzbl %sil,%esi 1c: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax 23: 01 01 01 26: 48 0f af c6 imul %rsi,%rax * 2a: f3 48 ab rep stos %rax,%es:(%rdi) <-- trapping instruction 2d: 89 d1 mov %edx,%ecx 2f: f3 aa rep stos %al,%es:(%rdi) 31: 4c 89 c8 mov %r9,%rax 34: c3 retq 35: 90 nop 36: 49 89 f9 mov %rdi,%r9 39: 40 88 f0 mov %sil,%al 3c: 48 89 d1 mov %rdx,%rcx 3f: f3 repz